Skip to content

Instantly share code, notes, and snippets.

@jglick
Last active October 1, 2020 19:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jglick/a8613fd72bbb52a8576804e9dbd10081 to your computer and use it in GitHub Desktop.
Save jglick/a8613fd72bbb52a8576804e9dbd10081 to your computer and use it in GitHub Desktop.
Script to launch Slack on Xubuntu with an icon
#!/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
@elysrivero99
Copy link

Thanks

@Rekhyt
Copy link

Rekhyt commented Jul 15, 2019

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