aboutsummaryrefslogtreecommitdiff
path: root/.config/rofi/applets/android/quicklinks.sh
diff options
context:
space:
mode:
authorAlec Goncharow <algo@cloudflare.com>2022-02-20 11:50:35 -0500
committerAlec Goncharow <algo@cloudflare.com>2022-02-20 11:50:35 -0500
commitf5abca7278f3ac0c7358e6f30db8a15da45a1e3b (patch)
tree96889e1a2cc2367b8461414ae7c94d9050b84890 /.config/rofi/applets/android/quicklinks.sh
parent3e0c8208ccbead65cd434fe730223a7ab854c377 (diff)
parent72cf398a6292fa56d57e82caa4d21570e5573294 (diff)
Merge branch 'desktop' of github.com:AlecGoncharow/dotfiles into desktop
Diffstat (limited to '.config/rofi/applets/android/quicklinks.sh')
-rwxr-xr-x.config/rofi/applets/android/quicklinks.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/.config/rofi/applets/android/quicklinks.sh b/.config/rofi/applets/android/quicklinks.sh
new file mode 100755
index 0000000..e2ae62f
--- /dev/null
+++ b/.config/rofi/applets/android/quicklinks.sh
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+## Author : Aditya Shakya
+## Mail : adi1090x@gmail.com
+## Github : @adi1090x
+## Twitter : @adi1090x
+
+dir="$HOME/.config/rofi/applets/android"
+rofi_command="rofi -theme $dir/six.rasi"
+
+# Error msg
+msg() {
+ rofi -theme "$dir/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 : Firefox" -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
+