Browsing Tag : dev

Tweaking running app icons

New year means New Epic Linux Desktop customization.
Useless therefore essential.
This is the way.

Soooo… time for a yearly post of pretty useless shell commands!

On XFCE, I was using the epic Ubo icons to customize the desktop panel.

I faced two issues when setting up the Firefox button :

  • If an existing Firefox instance is running but not activated (minimized or behind other windows), I want to activate it instead of creating a new one.
  • While the launcher icon is OK, the running app icon is still showing the default app icon.

Here’s an example of how I dealt with the issue, using wmctrl and xseticon.

!/bin/bash

APP_CLASS="Navigator.firefox"
APP_PATH="firefox"
ICON_PATH="/path/to/icon.png"

# wmctrl can display various info on running windows (PID, class, etc)
RUNNING_WINDOWS=`wmctrl -l -x | grep ${APP_CLASS}`
if [ -n "${RUNNING_WINDOWS}" ]; then
    # Activate any window matching given pattern
    wmctrl -x -a ${APP_CLASS}
else
    ${APP_PATH} &
fi

sleep 1
# Get window PIDs (1st column of wmctrl returned strings).
# There can be multiple matches !
# In this case, we use the xargs command :
# by using '-I %', we tell that any occurence of the '%' character 
# will be replaced by input.
wmctrl -l -x | grep ${APP_CLASS} | cut -d ' ' -f 1 \
                                | xargs -I % xseticon -id % $ICON_PATH

Read More...

Cantosearch

Happy new year ! I’ve started cantosearch, a little terminal toolkit which helps me querying different cantonese resource websites.

For now, it allows me to query the great www.cantonese.sheik.co.uk dictionary like this :

mrpingouin@localhost:~$ python3 cantosearch.py -j "faai lok"
Found 11 jyutping entries
新年快樂	san1nin4faai3lok6	Happy New Year
聖誕快樂	sing3daan3faai3lok6	Merry Christmas
快樂	faai3lok6	happy; joyous
生日快樂	saang1jat6faai3lok6	Happy Birthday!
天天快樂	tin1tin1faai3lok6	happy everyday
快樂主義	faai3lok6zyu2ji6	hedonism
不快樂	bat1faai3lok6	國unhappy
情人節快樂	cing4jan4zit3faai3lok6	Happy Valentine's Day
快樂幸福	faai3lok6hang6fuk1	cheerful, happy
元宵節快樂	jyun4siu1zit3faai3lok6	Happy Lantern Festival!
快速以太網絡	faai3cuk1ji5taai3mong5lok3	Fast Ethernet

# Using an alias makes it even more effective
alias cs="python3 cantosearch.py"

It should be sufficient for a while, although I might add support for other resources like cantonese.org, or yellowbridge.com.

Wise Garden is on Steam

Finally ! After working on it for almost two years and a half on our spare time with the great Thibault Barbaroux and the unstoppable Kévin Loustau, our very first project Wise Garden released under the Double Machine flag !

Many thanks to all the people who helped us, and most of all, all hail the magnificent Godot Engine.

Pro-tip : starting a first project with a puzzle game with complex mechanics is not a good idea 😑

Wise Garden Gif