diff --git a/README.md b/README.md index b39aa52..a3bab8d 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,10 @@ cd scripts |--|--| |![img](images/menus/9.png)|![img](images/menus/10.png)| +### Android Style Sidemenus + +![gif](images/android.gif)
+ ### Colorschemes The files are stored in *~/.config/rofi/themes/colorschemes*. diff --git a/android/apps.sh b/android/apps.sh new file mode 100755 index 0000000..285e462 --- /dev/null +++ b/android/apps.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## browser : @adi1090x +## music : @adi1090x + +rofi_command="rofi -theme android/six.rasi" + +# Links +terminal="" +files="" +editor="" +browser="" +music="" +settings="" + +# Variable passed to rofi +options="$terminal\n$files\n$editor\n$browser\n$music\n$settings" + +chosen="$(echo -e "$options" | $rofi_command -p "Most Used" -dmenu -selected-row 0)" +case $chosen in + $terminal) + termite & + ;; + $files) + thunar & + ;; + $editor) + geany & + ;; + $browser) + firefox & + ;; + $music) + lxmusic & + ;; + $settings) + xfce4-settings-manager & + ;; +esac + diff --git a/android/backlight.sh b/android/backlight.sh new file mode 100755 index 0000000..37b8a66 --- /dev/null +++ b/android/backlight.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +rofi_command="rofi -theme android/three.rasi" + +## Get Brightness +VAR="$(xbacklight -get)" +BLIGHT="$(printf "%.0f\n" "$VAR")" + +if [[ $BLIGHT -ge 1 ]] && [[ $BLIGHT -le 29 ]]; then + MSG="Low" +elif [[ $BLIGHT -ge 30 ]] && [[ $BLIGHT -le 49 ]]; then + MSG="Optimal" +elif [[ $BLIGHT -ge 50 ]] && [[ $BLIGHT -le 69 ]]; then + MSG="High" +elif [[ $BLIGHT -ge 70 ]] && [[ $BLIGHT -le 99 ]]; then + MSG="Too Much" +fi + +## Icons +ICON_UP="" +ICON_DOWN="" +ICON_OPT="" + +options="$ICON_UP\n$ICON_OPT\n$ICON_DOWN" + +## Main +chosen="$(echo -e "$options" | $rofi_command -p "$BLIGHT%" -dmenu -selected-row 1)" +case $chosen in + $ICON_UP) + xbacklight -inc 10 && notify-send -u low -t 1500 "Brightness Up $ICON_UP" + ;; + $ICON_DOWN) + xbacklight -dec 10 && notify-send -u low -t 1500 "Brightness Down $ICON_DOWN" + ;; + $ICON_OPT) + xbacklight -set 35 && notify-send -u low -t 1500 "Optimal Brightness $ICON_OPT" + ;; +esac + diff --git a/android/colors.rasi b/android/colors.rasi new file mode 100644 index 0000000..8cd5c93 --- /dev/null +++ b/android/colors.rasi @@ -0,0 +1,22 @@ +/* + * Change the colorscheme for every menu simply by editing this file... + * + * Available Color Schemes + * // Dark + * material-dark/amber material-dark/blue material-dark/blue_grey material-dark/brown material-dark/cyan material-dark/deep_orange + * material-dark/deep_purple material-dark/green material-dark/grey material-dark/indigo material-dark/light_blue material-dark/light_green + * material-dark/lime material-dark/orange material-dark/pink material-dark/purple material-dark/red material-dark/teal + * material-dark/yellow + * // Light + * material-light/amber material-light/blue material-light/blue_grey material-light/brown material-light/cyan material-light/deep_orange + * material-light/deep_purple material-light/green material-light/grey material-light/indigo material-light/light_blue material-light/light_green + * material-light/lime material-light/orange material-light/pink material-light/purple material-light/red material-light/teal + * material-light/yellow + * + * // Other + * adapta, adapta-nokto, arc, arc-dark, adwaita, gruvbox, dark + * armchair, darkpink, fresh, inside, party, sirin + * + */ + +@import "../themes/colorschemes/arc.rasi" diff --git a/android/five.rasi b/android/five.rasi new file mode 100644 index 0000000..24676f1 --- /dev/null +++ b/android/five.rasi @@ -0,0 +1,110 @@ +/* + * + * Author : Aditya Shakya (adi1090x) + * Mail : adi1090x@gmail.com + * Github : @adi1090x + * Reddit : @adi1090x + * + */ + +@import "colors.rasi" + +* { + /* General */ + text-font: "Comfortaa 12"; + icon-font: "feather 18"; + + option-6-listview-spacing: 6px; + menu-window-padding: 6px 6px; + menu-element-padding: 20px 0px 15px -10px; +} + +#window { + width: 6%; + height: 46%; + anchor: east; + location: east; + x-offset: -1%; + y-offset: 0%; + border: 0px; + border-radius: 12px; +} + +* { + background-color: @background; + text-color: @foreground; + font: @icon-font; +} + +#horibox { + children: [ listview ]; +} + +#listview { + layout: vertical; +} + +#element { + border: 0px; + border-radius: 10px; + padding: @option-element-padding; + background-color: @background-light; +} + +#element.selected { + background-color: @accent; + text-color: @background; +} + +* { + font: @text-font; +} + +#window { + padding: @menu-window-padding; + children: [ inputbar, horibox ]; +} + +#inputbar { + enabled: false; + children: [ textbox-prompt-colon, prompt ]; + margin: @menu-inputbar-margin; +} + +#listview { + spacing: @option-6-listview-spacing; + lines: 3; +} + +#element { + font: @icon-font; + border: @menu-element-border; + padding: @menu-element-padding; + border-color: @background-light; +} + +#element.selected { + border-color: @accent; +} + +element.active, +element.selected.urgent { + background-color: @on; + text-color: @background; + border-color: @on; +} + +element.selected.urgent { + border-color: @accent; +} + +element.urgent, +element.selected.active { + background-color: @off; + text-color: @background; + border-color: @off; +} + +element.selected.active { + border-color: @accent; +} diff --git a/android/mpd.sh b/android/mpd.sh new file mode 100755 index 0000000..9c2ba87 --- /dev/null +++ b/android/mpd.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +rofi_command="rofi -theme android/six.rasi" + +# Gets the current status of mpd (for us to parse it later on) +status="$(mpc status)" +# Defines the Play / Pause option content +if [[ $status == *"[playing]"* ]]; then + play_pause="" +else + play_pause="" +fi +active="" +urgent="" + +# Display if repeat mode is on / off +tog_repeat="" +if [[ $status == *"repeat: on"* ]]; then + active="-a 4" +elif [[ $status == *"repeat: off"* ]]; then + urgent="-u 4" +else + tog_repeat=" Parsing error" +fi + +# Display if random mode is on / off +tog_random="" +if [[ $status == *"random: on"* ]]; then + [ -n "$active" ] && active+=",5" || active="-a 5" +elif [[ $status == *"random: off"* ]]; then + [ -n "$urgent" ] && urgent+=",5" || urgent="-u 5" +else + tog_random=" Parsing error" +fi +stop="" +next="" +previous="" + +# Variable passed to rofi +options="$previous\n$play_pause\n$stop\n$next\n$tog_repeat\n$tog_random" + +# Get the current playing song +current=$(mpc -f %title% current) +# If mpd isn't running it will return an empty string, we don't want to display that +if [[ -z "$current" ]]; then + current="-" +fi + +# Spawn the mpd menu with the "Play / Pause" entry selected by default +chosen="$(echo -e "$options" | $rofi_command -p " $current" -dmenu $active $urgent -selected-row 1)" +case $chosen in + $previous) + mpc -q prev && notify-send -u low -t 1800 " $(mpc current)" + ;; + $play_pause) + mpc -q toggle && notify-send -u low -t 1800 " $(mpc current)" + ;; + $stop) + mpc -q stop + ;; + $next) + mpc -q next && notify-send -u low -t 1800 " $(mpc current)" + ;; + $tog_repeat) + mpc -q repeat + ;; + $tog_random) + mpc -q random + ;; +esac diff --git a/android/powermenu.sh b/android/powermenu.sh new file mode 100755 index 0000000..5072823 --- /dev/null +++ b/android/powermenu.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +rofi_command="rofi -theme android/five.rasi" +uptime=$(uptime -p | sed -e 's/up //g') + +# Options +shutdown="" +reboot="" +lock="" +suspend="" +logout="" + +# Variable passed to rofi +options="$shutdown\n$reboot\n$lock\n$suspend\n$logout" + +chosen="$(echo -e "$options" | $rofi_command -p "UP - $uptime" -dmenu -selected-row 2)" +case $chosen in + $shutdown) + systemctl poweroff + ;; + $reboot) + systemctl reboot + ;; + $lock) + i3lock + ;; + $suspend) + mpc -q pause + amixer set Master mute + systemctl suspend + ;; + $logout) + openbox --exit + ;; +esac + diff --git a/android/quicklinks.sh b/android/quicklinks.sh new file mode 100755 index 0000000..84b3497 --- /dev/null +++ b/android/quicklinks.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +rofi_command="rofi -theme android/six.rasi" + +# 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) + firefox --new-tab https://www.google.com + ;; + $facebook) + firefox --new-tab https://www.facebook.com + ;; + $twitter) + firefox --new-tab https://www.twitter.com + ;; + $github) + firefox --new-tab https://www.github.com + ;; + $mail) + firefox --new-tab https://www.gmail.com + ;; + $youtube) + firefox --new-tab https://www.youtube.com + ;; +esac + diff --git a/android/screenshot.sh b/android/screenshot.sh new file mode 100755 index 0000000..f969e4e --- /dev/null +++ b/android/screenshot.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +rofi_command="rofi -theme android/three.rasi" + +# Options +screen="" +area="" +window="" + +# Variable passed to rofi +options="$screen\n$area\n$window" + +chosen="$(echo -e "$options" | $rofi_command -p '' -dmenu -selected-row 1)" +case $chosen in + $screen) + sleep 1; scrot 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' + ;; + $area) + scrot -s 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' + ;; + $window) + sleep 1; scrot -u 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' + ;; +esac + diff --git a/android/six.rasi b/android/six.rasi new file mode 100644 index 0000000..9b069fa --- /dev/null +++ b/android/six.rasi @@ -0,0 +1,110 @@ +/* + * + * Author : Aditya Shakya (adi1090x) + * Mail : adi1090x@gmail.com + * Github : @adi1090x + * Reddit : @adi1090x + * + */ + +@import "colors.rasi" + +* { + /* General */ + text-font: "Comfortaa 12"; + icon-font: "feather 18"; + + option-6-listview-spacing: 6px; + menu-window-padding: 6px 6px; + menu-element-padding: 20px 0px 15px -10px; +} + +#window { + width: 6%; + height: 55%; + anchor: east; + location: east; + x-offset: -1%; + y-offset: 0%; + border: 0px; + border-radius: 12px; +} + +* { + background-color: @background; + text-color: @foreground; + font: @icon-font; +} + +#horibox { + children: [ listview ]; +} + +#listview { + layout: vertical; +} + +#element { + border: 0px; + border-radius: 10px; + padding: @option-element-padding; + background-color: @background-light; +} + +#element.selected { + background-color: @accent; + text-color: @background; +} + +* { + font: @text-font; +} + +#window { + padding: @menu-window-padding; + children: [ inputbar, horibox ]; +} + +#inputbar { + enabled: false; + children: [ textbox-prompt-colon, prompt ]; + margin: @menu-inputbar-margin; +} + +#listview { + spacing: @option-6-listview-spacing; + lines: 3; +} + +#element { + font: @icon-font; + border: @menu-element-border; + padding: @menu-element-padding; + border-color: @background-light; +} + +#element.selected { + border-color: @accent; +} + +element.active, +element.selected.urgent { + background-color: @on; + text-color: @background; + border-color: @on; +} + +element.selected.urgent { + border-color: @accent; +} + +element.urgent, +element.selected.active { + background-color: @off; + text-color: @background; + border-color: @off; +} + +element.selected.active { + border-color: @accent; +} diff --git a/android/three.rasi b/android/three.rasi new file mode 100644 index 0000000..3c3ec93 --- /dev/null +++ b/android/three.rasi @@ -0,0 +1,110 @@ +/* + * + * Author : Aditya Shakya (adi1090x) + * Mail : adi1090x@gmail.com + * Github : @adi1090x + * Reddit : @adi1090x + * + */ + +@import "colors.rasi" + +* { + /* General */ + text-font: "Comfortaa 12"; + icon-font: "feather 18"; + + option-6-listview-spacing: 6px; + menu-window-padding: 6px 6px; + menu-element-padding: 20px 0px 15px -10px; +} + +#window { + width: 6%; + height: 28%; + anchor: east; + location: east; + x-offset: -1%; + y-offset: 0%; + border: 0px; + border-radius: 12px; +} + +* { + background-color: @background; + text-color: @foreground; + font: @icon-font; +} + +#horibox { + children: [ listview ]; +} + +#listview { + layout: vertical; +} + +#element { + border: 0px; + border-radius: 10px; + padding: @option-element-padding; + background-color: @background-light; +} + +#element.selected { + background-color: @accent; + text-color: @background; +} + +* { + font: @text-font; +} + +#window { + padding: @menu-window-padding; + children: [ inputbar, horibox ]; +} + +#inputbar { + enabled: false; + children: [ textbox-prompt-colon, prompt ]; + margin: @menu-inputbar-margin; +} + +#listview { + spacing: @option-6-listview-spacing; + lines: 3; +} + +#element { + font: @icon-font; + border: @menu-element-border; + padding: @menu-element-padding; + border-color: @background-light; +} + +#element.selected { + border-color: @accent; +} + +element.active, +element.selected.urgent { + background-color: @on; + text-color: @background; + border-color: @on; +} + +element.selected.urgent { + border-color: @accent; +} + +element.urgent, +element.selected.active { + background-color: @off; + text-color: @background; + border-color: @off; +} + +element.selected.active { + border-color: @accent; +} diff --git a/android/volume.sh b/android/volume.sh new file mode 100755 index 0000000..9135265 --- /dev/null +++ b/android/volume.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +rofi_command="rofi -theme android/three.rasi" + +## Get Volume +#VOLUME=$(amixer get Master | tail -n 1 | awk -F ' ' '{print $5}' | tr -d '[]%') +MUTE=$(amixer get Master | tail -n 1 | awk -F ' ' '{print $6}' | tr -d '[]%') + +active="" +urgent="" + +if [[ $MUTE == *"off"* ]]; then + active="-a 1" +else + urgent="-u 1" +fi + +if [[ $MUTE == *"off"* ]]; then + active="-a 1" +else + urgent="-u 1" +fi + +if [[ $MUTE == *"on"* ]]; then + VOLUME="$(amixer get Master | tail -n 1 | awk -F ' ' '{print $5}' | tr -d '[]%')%" +else + VOLUME="Mu..." +fi + +## Icons +ICON_UP="" +ICON_DOWN="" +ICON_MUTED="" + +options="$ICON_UP\n$ICON_MUTED\n$ICON_DOWN" + +## Main +chosen="$(echo -e "$options" | $rofi_command -p "$VOLUME" -dmenu $active $urgent -selected-row 0)" +case $chosen in + $ICON_UP) + amixer -Mq set Master,0 5%+ unmute && notify-send -u low -t 1500 "Volume Up $ICON_UP" + ;; + $ICON_DOWN) + amixer -Mq set Master,0 5%- unmute && notify-send -u low -t 1500 "Volume Down $ICON_DOWN" + ;; + $ICON_MUTED) + amixer -q set Master toggle + ;; +esac + diff --git a/fonts/feather.ttf b/fonts/feather.ttf new file mode 100644 index 0000000..88bdfd0 Binary files /dev/null and b/fonts/feather.ttf differ diff --git a/images/android.gif b/images/android.gif new file mode 100644 index 0000000..c0f1b81 Binary files /dev/null and b/images/android.gif differ