Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Created April 10, 2017 16:26
Show Gist options
  • Save molotovbliss/67c54e628c55c48891fd322983c2011a to your computer and use it in GitHub Desktop.
Save molotovbliss/67c54e628c55c48891fd322983c2011a to your computer and use it in GitHub Desktop.
Fix Win Buttons XFCE4 Panel for apps with missing icons
#!/bin/bash
# Configure below according to the app you're trying to fix the icon for in Window Buttons Panel
# Point any shortcuts/panel entries to this .sh file with full path ensure +x execute abilities
# configure
WIN_NAME="Termius";
APP_EXEC="/snap/bin/termius-app";
APP_ICON="/snap/termius-app/current/meta/gui/icon.png";
# how long to wait before looking for window title
TIME_WAIT_FOR_WINDOW=3;
# dependencies
if !hash xseticon 2>/dev/null; then
echo "xseticon not found attempting to install...";
wget https://gist.githubusercontent.com/unhammer/cfa9cd907adcdf391290/raw/5ec5f5e9a81079d12de32b761e575fc57a4556e4/get-xseticon.sh;
chmod +x get-seticon.sh;
./get-seticon.sh;
fi
if !hash xwininfo 2>/dev/null; then
echo "xwininfo not found.";
exit 0;
fi
$APP_EXEC &
sleep $TIME_WAIT_FOR_WINDOW;
env BAMF_DESKTOP_FILE_HINT="/var/lib/snapd/desktop/applications/termius-app_termius-app.desktop";
ID=$(xwininfo -name "$WIN_NAME"|grep xwininfo|cut -d ' ' -f 4);
xseticon -id $ID $APP_ICON;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment