Skip to content

Instantly share code, notes, and snippets.

@davidar
Created August 13, 2016 06:03
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidar/8801d72003358612adcb0b0a245a76d3 to your computer and use it in GitHub Desktop.
Save davidar/8801d72003358612adcb0b0a245a76d3 to your computer and use it in GitHub Desktop.
Fix Chrome App icons in the KDE launcher
#!/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