first commit
This commit is contained in:
commit
78b79e224f
239 changed files with 14912 additions and 0 deletions
42
rofi/scripts/apps.sh
Executable file
42
rofi/scripts/apps.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## browser : @adi1090x
|
||||
## music : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/apps.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)
|
||||
alacritty &
|
||||
;;
|
||||
$files)
|
||||
thunar &
|
||||
;;
|
||||
$editor)
|
||||
geany &
|
||||
;;
|
||||
$browser)
|
||||
firefox &
|
||||
;;
|
||||
$music)
|
||||
lxmusic &
|
||||
;;
|
||||
$settings)
|
||||
xfce4-settings-manager &
|
||||
;;
|
||||
esac
|
||||
|
44
rofi/scripts/backlight.sh
Executable file
44
rofi/scripts/backlight.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/backlight.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
|
||||
|
59
rofi/scripts/battery.sh
Executable file
59
rofi/scripts/battery.sh
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/battery.rasi"
|
||||
|
||||
## Get data
|
||||
|
||||
BATTERY="$(acpi | awk -F ' ' '{print $4}' | tr -d \%,)"
|
||||
CHARGE="$(acpi | awk -F ' ' '{print $3}' | tr -d \,)"
|
||||
|
||||
active=""
|
||||
urgent=""
|
||||
|
||||
if [[ $CHARGE = *"Charging"* ]]; then
|
||||
active="-a 1"
|
||||
ICON_CHRG=""
|
||||
MSG=$CHARGE
|
||||
else
|
||||
urgent="-u 1"
|
||||
ICON_CHRG="ﮤ"
|
||||
MSG="Discharging"
|
||||
fi
|
||||
|
||||
# Discharging
|
||||
#if [[ $CHARGE -eq 1 ]] && [[ $BATTERY -eq 100 ]]; then
|
||||
# ICON_DISCHRG=""
|
||||
if [[ $BATTERY -ge 5 ]] && [[ $BATTERY -le 19 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 20 ]] && [[ $BATTERY -le 39 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 40 ]] && [[ $BATTERY -le 59 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 60 ]] && [[ $BATTERY -le 79 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 80 ]] && [[ $BATTERY -le 100 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
fi
|
||||
|
||||
## Icons
|
||||
ICON_PMGR=""
|
||||
|
||||
options="$ICON_DISCHRG\n$ICON_CHRG\n$ICON_PMGR"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "$BATTERY%" -dmenu $active $urgent -selected-row 0)"
|
||||
case $chosen in
|
||||
$ICON_CHRG)
|
||||
;;
|
||||
$ICON_DISCHRG)
|
||||
;;
|
||||
$ICON_PMGR)
|
||||
xfce4-power-manager-settings
|
||||
;;
|
||||
esac
|
||||
|
42
rofi/scripts/menu_apps.sh
Executable file
42
rofi/scripts/menu_apps.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## browser : @adi1090x
|
||||
## music : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/apps.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
rofi/scripts/menu_backlight.sh
Executable file
44
rofi/scripts/menu_backlight.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/backlight.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% : $MSG" -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
|
||||
|
58
rofi/scripts/menu_battery.sh
Executable file
58
rofi/scripts/menu_battery.sh
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/battery.rasi"
|
||||
|
||||
## Get data
|
||||
BATTERY="$(acpi | awk -F ' ' '{print $4}' | tr -d \%,)"
|
||||
CHARGE="$(acpi | awk -F ' ' '{print $3}' | tr -d \,)"
|
||||
|
||||
active=""
|
||||
urgent=""
|
||||
|
||||
if [[ $CHARGE = *"Charging"* ]]; then
|
||||
active="-a 1"
|
||||
ICON_CHRG=""
|
||||
MSG=$CHARGE
|
||||
else
|
||||
urgent="-u 1"
|
||||
ICON_CHRG="ﮤ"
|
||||
MSG="Discharging"
|
||||
fi
|
||||
|
||||
# Discharging
|
||||
#if [[ $CHARGE -eq 1 ]] && [[ $BATTERY -eq 100 ]]; then
|
||||
# ICON_DISCHRG=""
|
||||
if [[ $BATTERY -ge 5 ]] && [[ $BATTERY -le 19 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 20 ]] && [[ $BATTERY -le 39 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 40 ]] && [[ $BATTERY -le 59 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 60 ]] && [[ $BATTERY -le 79 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
elif [[ $BATTERY -ge 80 ]] && [[ $BATTERY -le 100 ]]; then
|
||||
ICON_DISCHRG=""
|
||||
fi
|
||||
|
||||
## Icons
|
||||
ICON_PMGR=""
|
||||
|
||||
options="$ICON_DISCHRG\n$ICON_CHRG\n$ICON_PMGR"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "$MSG : $BATTERY%" -dmenu $active $urgent -selected-row 0)"
|
||||
case $chosen in
|
||||
$ICON_CHRG)
|
||||
;;
|
||||
$ICON_DISCHRG)
|
||||
;;
|
||||
$ICON_PMGR)
|
||||
xfce4-power-manager-settings
|
||||
;;
|
||||
esac
|
||||
|
70
rofi/scripts/menu_mpd.sh
Executable file
70
rofi/scripts/menu_mpd.sh
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rofi_command="rofi -theme themes/menu/mpd.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 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
|
65
rofi/scripts/menu_network.sh
Executable file
65
rofi/scripts/menu_network.sh
Executable file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/network.rasi"
|
||||
|
||||
## Get info
|
||||
IFACE="$(nmcli | grep -i interface | awk '/interface/ {print $2}')"
|
||||
#SSID="$(iwgetid -r)"
|
||||
#LIP="$(nmcli | grep -i server | awk '/server/ {print $2}')"
|
||||
#PIP="$(dig +short myip.opendns.com @resolver1.opendns.com )"
|
||||
STATUS="$(nmcli radio wifi)"
|
||||
|
||||
active=""
|
||||
urgent=""
|
||||
|
||||
if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
if [[ $IFACE == e* ]]; then
|
||||
connected=""
|
||||
else
|
||||
connected="直"
|
||||
fi
|
||||
active="-a 0"
|
||||
SSID=" $(iwgetid -r)"
|
||||
PIP="$(dig +short myip.opendns.com @resolver1.opendns.com )"
|
||||
fi
|
||||
else
|
||||
urgent="-u 0"
|
||||
SSID="Disconnected"
|
||||
PIP="Not Available"
|
||||
connected="睊"
|
||||
fi
|
||||
|
||||
## Icons
|
||||
bmon="龍"
|
||||
launch_cli=""
|
||||
launch="歷"
|
||||
|
||||
options="$connected\n$bmon\n$launch_cli\n$launch"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "$SSID : $PIP" -dmenu $active $urgent -selected-row 1)"
|
||||
case $chosen in
|
||||
$connected)
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
nmcli radio wifi off
|
||||
else
|
||||
nmcli radio wifi on
|
||||
fi
|
||||
;;
|
||||
$bmon)
|
||||
termite -e bmon
|
||||
;;
|
||||
$launch_cli)
|
||||
termite -e nmtui
|
||||
;;
|
||||
$launch)
|
||||
nm-connection-editor
|
||||
;;
|
||||
esac
|
||||
|
44
rofi/scripts/menu_powermenu.sh
Executable file
44
rofi/scripts/menu_powermenu.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/powermenu.rasi"
|
||||
uptime=$(uptime -p | sed -e 's/up //g')
|
||||
#mem=$( free -h | grep -i mem | awk -F ' ' '{print $3}')
|
||||
cpu=$(sh ~/.config/rofi/bin/usedcpu)
|
||||
memory=$(sh ~/.config/rofi/bin/usedram)
|
||||
|
||||
# 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 "祥 $uptime $cpu $memory " -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
rofi/scripts/menu_quicklinks.sh
Executable file
42
rofi/scripts/menu_quicklinks.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/quicklinks.rasi"
|
||||
|
||||
# Links
|
||||
google=""
|
||||
facebook=""
|
||||
twitter=""
|
||||
github=""
|
||||
reddit=""
|
||||
youtube=""
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$google\n$facebook\n$twitter\n$github\n$reddit\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
|
||||
;;
|
||||
$reddit)
|
||||
firefox --new-tab https://www.reddit.com
|
||||
;;
|
||||
$youtube)
|
||||
firefox --new-tab https://www.youtube.com
|
||||
;;
|
||||
esac
|
||||
|
30
rofi/scripts/menu_screenshot.sh
Executable file
30
rofi/scripts/menu_screenshot.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/screenshot.rasi"
|
||||
|
||||
# Options
|
||||
screen=""
|
||||
area=""
|
||||
window=""
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$screen\n$area\n$window"
|
||||
|
||||
chosen="$(echo -e "$options" | $rofi_command -p 'scrot' -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
|
||||
|
21
rofi/scripts/menu_time.sh
Executable file
21
rofi/scripts/menu_time.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/time.rasi"
|
||||
|
||||
## Get time and date
|
||||
TIME="$(date +"%I:%M %p")"
|
||||
DN=$(date +"%A")
|
||||
MN=$(date +"%B")
|
||||
DAY="$(date +"%d")"
|
||||
MONTH="$(date +"%m")"
|
||||
YEAR="$(date +"%Y")"
|
||||
|
||||
options="$DAY\n$MONTH\n$YEAR"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p " at $TIME on $DN in $MN" -dmenu -selected-row 1)"
|
49
rofi/scripts/menu_volume.sh
Executable file
49
rofi/scripts/menu_volume.sh
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/menu/volume.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 == *"on"* ]]; then
|
||||
VOLUME="$(amixer get Master | tail -n 1 | awk -F ' ' '{print $5}' | tr -d '[]%')%"
|
||||
else
|
||||
VOLUME="Muted"
|
||||
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
|
||||
|
70
rofi/scripts/mpd.sh
Executable file
70
rofi/scripts/mpd.sh
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rofi_command="rofi -theme themes/mpd.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
|
65
rofi/scripts/network.sh
Executable file
65
rofi/scripts/network.sh
Executable file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/network.rasi"
|
||||
|
||||
## Get info
|
||||
IFACE="$(nmcli | grep -i interface | awk '/interface/ {print $2}')"
|
||||
#SSID="$(iwgetid -r)"
|
||||
#LIP="$(nmcli | grep -i server | awk '/server/ {print $2}')"
|
||||
#PIP="$(dig +short myip.opendns.com @resolver1.opendns.com )"
|
||||
STATUS="$(nmcli radio wifi)"
|
||||
|
||||
active=""
|
||||
urgent=""
|
||||
|
||||
if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
if [[ $IFACE == e* ]]; then
|
||||
connected=""
|
||||
else
|
||||
connected="直"
|
||||
fi
|
||||
active="-a 0"
|
||||
MSG=" Online"
|
||||
PIP="$(dig +short myip.opendns.com @resolver1.opendns.com )"
|
||||
fi
|
||||
else
|
||||
urgent="-u 0"
|
||||
MSG="Offline"
|
||||
PIP="Not Available"
|
||||
connected="睊"
|
||||
fi
|
||||
|
||||
## Icons
|
||||
bmon="龍"
|
||||
launch_cli=""
|
||||
launch="歷"
|
||||
|
||||
options="$connected\n$bmon\n$launch_cli\n$launch"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "$MSG" -dmenu $active $urgent -selected-row 1)"
|
||||
case $chosen in
|
||||
$connected)
|
||||
if [[ $STATUS == *"enable"* ]]; then
|
||||
nmcli radio wifi off
|
||||
else
|
||||
nmcli radio wifi on
|
||||
fi
|
||||
;;
|
||||
$bmon)
|
||||
termite -e bmon
|
||||
;;
|
||||
$launch_cli)
|
||||
termite -e nmtui
|
||||
;;
|
||||
$launch)
|
||||
nm-connection-editor
|
||||
;;
|
||||
esac
|
||||
|
41
rofi/scripts/powermenu.sh
Executable file
41
rofi/scripts/powermenu.sh
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/powermenu.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
rofi/scripts/quicklinks.sh
Executable file
42
rofi/scripts/quicklinks.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/quicklinks.rasi"
|
||||
|
||||
# Links
|
||||
google=""
|
||||
facebook=""
|
||||
twitter=""
|
||||
github=""
|
||||
reddit=""
|
||||
youtube=""
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$google\n$facebook\n$twitter\n$github\n$reddit\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
|
||||
;;
|
||||
$reddit)
|
||||
firefox --new-tab https://www.reddit.com
|
||||
;;
|
||||
$youtube)
|
||||
firefox --new-tab https://www.youtube.com
|
||||
;;
|
||||
esac
|
||||
|
30
rofi/scripts/screenshot.sh
Executable file
30
rofi/scripts/screenshot.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/screenshot.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
|
||||
|
19
rofi/scripts/time.sh
Executable file
19
rofi/scripts/time.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/time.rasi"
|
||||
|
||||
## Get time and date
|
||||
TIME="$(date +"%A, %I:%M %p")"
|
||||
DAY="$(date +"%d")"
|
||||
MONTH="$(date +"%m")"
|
||||
YEAR="$(date +"%Y")"
|
||||
|
||||
options="$DAY\n$MONTH\n$YEAR"
|
||||
|
||||
## Main
|
||||
chosen="$(echo -e "$options" | $rofi_command -p " $TIME" -dmenu -selected-row 1)"
|
55
rofi/scripts/volume.sh
Executable file
55
rofi/scripts/volume.sh
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya (adi1090x)
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Reddit : @adi1090x
|
||||
|
||||
rofi_command="rofi -theme themes/volume.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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue