Android Style Sidemenus

This commit is contained in:
adi1090x 2020-03-19 19:34:32 +05:30
parent af57943a5f
commit 30d07a684d
14 changed files with 680 additions and 0 deletions

View File

@ -148,6 +148,10 @@ cd scripts
|--|--|
|![img](images/menus/9.png)|![img](images/menus/10.png)|
### Android Style Sidemenus
![gif](images/android.gif) <br />
### Colorschemes
The files are stored in *~/.config/rofi/themes/colorschemes*.

42
android/apps.sh Executable file
View File

@ -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

44
android/backlight.sh Executable file
View File

@ -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

22
android/colors.rasi Normal file
View File

@ -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"

110
android/five.rasi Normal file
View File

@ -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;
}

70
android/mpd.sh Executable file
View File

@ -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

41
android/powermenu.sh Executable file
View File

@ -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

42
android/quicklinks.sh Executable file
View File

@ -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

30
android/screenshot.sh Executable file
View File

@ -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

110
android/six.rasi Normal file
View File

@ -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;
}

110
android/three.rasi Normal file
View File

@ -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;
}

55
android/volume.sh Executable file
View File

@ -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

BIN
fonts/feather.ttf Normal file

Binary file not shown.

BIN
images/android.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB