Skip to content

Instantly share code, notes, and snippets.

@michaeljymsgutierrez
Last active March 17, 2024 11:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeljymsgutierrez/c57a63d044288e87cb30052bba3513cb to your computer and use it in GitHub Desktop.
Save michaeljymsgutierrez/c57a63d044288e87cb30052bba3513cb to your computer and use it in GitHub Desktop.
Set icon on window and panel - xseticon
#! /bin/bash
# @params $1: APP_NAME
# @params $2: ICON_PATH
# set-icon.sh Slack /usr/share/pixmaps/slack.png
# Note: Make sure xseticon is installed on your system
# If not installed: https://github.com/xeyownt/xseticon
# Either/usr/bin or /usr/local/bin is fine for script directory
# sudo cp set-icon.sh /usr/bin
# sudo chmod 777 /usr/bin/set-icon.sh
# Example usage on application.desktop
# Exec=/usr/bin/slack %U && set-icon.sh Slack /usr/share/pixmaps/slack.png
# Example usage on command line
# set-icon.sh Slack /usr/share/pixmaps/slack.png
sleep 15
window_details=$(wmctrl -l | grep $1)
read -a window_id <<< $window_details
xseticon -id $window_id $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment