Skip to content

Instantly share code, notes, and snippets.

@nick3499
Created July 13, 2023 23:46
Show Gist options
  • Save nick3499/4bf53b6f549aab4f848301fe51ad5e89 to your computer and use it in GitHub Desktop.
Save nick3499/4bf53b6f549aab4f848301fe51ad5e89 to your computer and use it in GitHub Desktop.
Desktop Launcher
#!/bin/sh
# Create Chromium URL-as-app launcher given name of video and URL
# Example:
# $ sh launcher-gen.sh 'Dark Drum and Bass - VOL 2' https://www.youtube.com/watch?v=55kZd_JDrfI
NAME="$1"
URL=$2
echo '[Desktop Entry]\nVersion=1.0\nType=Application' > /home/$USER/Desktop/$NAME.desktop
echo "Name=$NAME" >> /home/$USER/Desktop/$NAME.desktop
echo 'Comment=' >> /home/$USER/Desktop/$NAME.desktop
echo "Exec=chromium $URL" >> /home/$USER/Desktop/$NAME.desktop
echo 'Icon=/usr/share/icons/Flat-Remix-Blue-Dark/mimetypes/scalable/application-audio.svg' >> /home/$USER/Desktop/$NAME.desktop
echo 'Path=\nTerminal=false\nStartupNotify=false' >> /home/$USER/Desktop/$NAME.desktop
@nick3499
Copy link
Author

Original intention was to create desktop launchers for various music videos; to launch chromium and pass it a preset URL.

  • $NAME (argv[1]) stores the music video name
  • $URL (argv[2]) stores the video URL
  • Icon= could be left empty
  • Comment= could be left empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment