Created
August 13, 2016 06:03
-
-
Save davidar/8801d72003358612adcb0b0a245a76d3 to your computer and use it in GitHub Desktop.
Fix Chrome App icons in the KDE launcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://superuser.com/a/1068709/55113 | |
for file in ~/.local/share/applications/*.desktop; do | |
CLASS="`grep '^StartupWMClass=' "$file" | cut -d= -f2`" | |
if [ -n "$CLASS" ] && ! grep -q xdotool "$file"; then | |
EXEC="`grep '^Exec=' "$file"`" | |
EXEC="$EXEC \\&\\& xdotool search --sync --classname $CLASS set_window --class $CLASS" | |
sed -i~ "s!^Exec=.*!$EXEC!" "$file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment