Last active
October 1, 2020 19:56
-
-
Save jglick/a8613fd72bbb52a8576804e9dbd10081 to your computer and use it in GitHub Desktop.
Script to launch Slack on Xubuntu with an icon
This file contains hidden or 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 -xe | |
# adapted from https://launchpadlibrarian.net/422519169/slack via https://bugs.launchpad.net/ubuntu/+source/xfwm4/+bug/1827302/comments/12 | |
ICON=/snap/slack/current/usr/share/pixmaps/slack.png | |
nohup /snap/bin/slack | |
WINDOWS= | |
while [ -z "$WINDOWS" ] | |
do | |
WINDOWS=(`wmctrl -lx | fgrep slack.Slack | cut -f1 -d' '`) | |
sleep 1 | |
done | |
for slack_window in ${WINDOWS[@]}; do | |
/snap/xseticon/current/bin/xseticon -id ${slack_window} $ICON || echo xseticon failed, ignoring | |
done |
Thanks for posting this! 🙂
For it to work when not installed via DEB file, replace lines 4 and 6 with
ICON=/usr/share/pixmaps/slack.png
nohup /usr/bin/slack &
respectively.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks