diff options
author | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-01-23 11:13:18 +0100 |
---|---|---|
committer | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2024-01-23 11:13:18 +0100 |
commit | 72efe134f645a5212f875c153dd8db4a64cbe968 (patch) | |
tree | d23229285071bf381515657b94919852ebf426c9 /linux/rofi/applets/menu/quicklinks.sh | |
parent | e33d5f8d10d34e5a3a4bb292015961dd574f4c93 (diff) | |
download | dotfiles-72efe134f645a5212f875c153dd8db4a64cbe968.tar.gz dotfiles-72efe134f645a5212f875c153dd8db4a64cbe968.zip |
changes
Diffstat (limited to 'linux/rofi/applets/menu/quicklinks.sh')
-rwxr-xr-x | linux/rofi/applets/menu/quicklinks.sh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/linux/rofi/applets/menu/quicklinks.sh b/linux/rofi/applets/menu/quicklinks.sh new file mode 100755 index 0000000..c2f0495 --- /dev/null +++ b/linux/rofi/applets/menu/quicklinks.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +## Author : Aditya Shakya +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Twitter : @adi1090x + +style="$($HOME/.config/rofi/applets/menu/style.sh)" + +dir="$HOME/.config/rofi/applets/menu/configs/$style" +rofi_command="rofi -theme $dir/quicklinks.rasi" + +# Error msg +msg() { + rofi -theme "$HOME/.config/rofi/applets/styles/message.rasi" -e "$1" +} + +# Browser +if [[ -f /usr/bin/firefox ]]; then + app="firefox" +elif [[ -f /usr/bin/chromium ]]; then + app="chromium" +elif [[ -f /usr/bin/midori ]]; then + app="midori" +else + msg "No suitable web browser found!" + exit 1 +fi + +# Links +google="" +facebook="" +twitter="" +github="" +mail="" +youtube="" + +# Variable passed to rofi +options="$google\n$facebook\n$twitter\n$github\n$mail\n$youtube" + +chosen="$(echo -e "$options" | $rofi_command -p "Open In : $app" -dmenu -selected-row 0)" +case $chosen in + $google) + $app https://www.google.com & + ;; + $facebook) + $app https://www.facebook.com & + ;; + $twitter) + $app https://www.twitter.com & + ;; + $github) + $app https://www.github.com & + ;; + $mail) + $app https://www.gmail.com & + ;; + $youtube) + $app https://www.youtube.com & + ;; +esac + |