Skip to content

Commit

Permalink
scripts updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Drish-xD committed Jun 11, 2022
1 parent 52cd05f commit d717eed
Show file tree
Hide file tree
Showing 16 changed files with 373 additions and 464 deletions.
2 changes: 1 addition & 1 deletion .scripts/Polybar/change-brightness
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BRIGHTNESS_STEPS=5
notify()
{
BRIGHTNESS="$(brightnessctl i | grep -oP '\(\K[^%\)]+')"
exec $HOME/.scripts/notify/notify-send.sh -r 1234 -t 700 -i $HOME/.icons/UI/brightness.png "Brightness" "$BRIGHTNESS "
exec $HOME/.scripts/notify/notify-send.sh -r 1234 -t 700 -i $HOME/.icons/sun.svg "Brightness" "$BRIGHTNESS "
}

case ${1} in
Expand Down
8 changes: 4 additions & 4 deletions .scripts/Polybar/change-volume
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Get_Perc="$(pactl list sinks | grep '^[[:space:]]Volume:' | \

case ${1} in
up) amixer set Master 5%+ && \
exec ${HOME}/.scripts/notify/notify-send.sh -r 123 -t 700 -i "$HOME/.icons/UI/volume-medium.png" "Volume" " $Get_Perc% "
exec ${HOME}/.scripts/notify/notify-send.sh -r 123 -t 700 -i "$HOME/.icons/vol-2.svg" "Volume" " $Get_Perc% "
;;
down) amixer set Master 5%- && \
exec ${HOME}/.scripts/notify/notify-send.sh -r 123 -t 700 -i "$HOME/.icons/UI/volume-medium.png" "Volume" " $Get_Perc% "
exec ${HOME}/.scripts/notify/notify-send.sh -r 123 -t 700 -i "$HOME/.icons/vol-2.svg" "Volume" " $Get_Perc% "
;;
mute) amixer set Master toggle
if pactl get-sink-mute 0 0 | grep "yes"; then
exec "$HOME/.scripts/notify/notify-send.sh" -i $HOME/.icons/UI/Music.png -r 123 -t 700 'Muted '
exec "$HOME/.scripts/notify/notify-send.sh" -i $HOME/.icons/Vol-mute.svg -r 123 -t 700 'Muted '
elif pactl get-sink-mute 0 0 | grep "no"; then
exec "$HOME/.scripts/notify/notify-send.sh" -i $HOME/.icons/UI/Music.png -r 123 -t 700 'Alright, Unmuted'
exec "$HOME/.scripts/notify/notify-send.sh" -i $HOME/.icons/vol-2.svg -r 123 -t 700 'Alright, Unmuted'

fi
;;
Expand Down
4 changes: 2 additions & 2 deletions .scripts/Rofi/player-menu.sh → .scripts/Rofi/playermenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
playerctl status &> /dev/null
if test $? -eq 1
then
notify-send -t 700 -u normal "Player is not running"
notify-send -t 700 -u normal "Player is not running"
exit
fi



status="$(playerctl status -a | grep "Playing")"

ROFI="rofi -theme .scripts/Rofi/themes/three-horizontal.rasi"
ROFI="rofi -theme .scripts/Rofi/themes/player.rasi"

A='' B='' C=''

Expand Down
22 changes: 8 additions & 14 deletions .scripts/Rofi/powermenu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# #!/usr/bin/env bash

# Determine `systemd-logind` or `(e)logind`.
if [ -x "$(command -v systemctl)" ]; then
Expand All @@ -9,21 +9,17 @@ else
echo "failed"
fi

ROFI="rofi -theme .scripts/Rofi/themes/five-horizontal.rasi"
uptime=$(uptime -p | sed 's/up //' | sed 's/\ years\?,/y/' | sed 's/\ weeks\?,/w/' | sed 's/\ days\?,/d/' | sed 's/\ hours\?,\?/h/' | sed 's/\ minutes\?/m/')
ROFI="rofi -theme ~/.scripts/Rofi/themes/power.rasi"

A='' B='' C='' D='' E=''

MENU="$(printf "${A}\n${B}\n${C}\n${D}\n${E}\n" | ${ROFI} -dmenu -selected-row 0)"
MENU="$(printf "${A}\n${B}\n${C}\n${D}\n${E}\n" | ${ROFI} -dmenu -p "Up - $uptime" -selected-row 0)"

case "$MENU" in
"$A") exec "${HOME}/.scripts/Rofi/promptmenu.sh" \
--yes-command "${SEATCTL} poweroff" \
-q ' poweroff?'

"$A") exec "${HOME}/.scripts/Rofi/promptmenu.sh" --yes-command "${SEATCTL} poweroff" -q 'ShutDown?'
;;
"$B") exec "${HOME}/.scripts/Rofi/promptmenu.sh" \
--yes-command "${SEATCTL} reboot" \
--query ' reboot?'
"$B") exec "${HOME}/.scripts/Rofi/promptmenu.sh" --yes-command "${SEATCTL} reboot" -q 'Reboot?'
;;
"$C") betterlockscreen -l
;;
Expand All @@ -32,10 +28,8 @@ case "$MENU" in
fi
exec "$SEATCTL" suspend
;;
"$E") exec "${HOME}/.scripts/Rofi/promptmenu.sh" \
--yes-command "pkill -KILL -u $(id -nu || whoami)" \
-q ' Logout?'
"$E") exec "${HOME}/.scripts/Rofi/promptmenu.sh" --yes-command "pkill -KILL -u $(id -nu || whoami)" -q 'Logout?'
;;
esac

exit ${?}
exit ${?}
4 changes: 2 additions & 2 deletions .scripts/Rofi/promptmenu.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# credits to owl4ce!!!!

ROFI='rofi -theme ~/.scripts/Rofi/themes/promptmenu.rasi'
ROFI='rofi -theme ~/.scripts/Rofi/themes/prompt.rasi'

yes_text='Yeah' no_text='Nope' query='Really???'
yes_text='' no_text='' query='Are You Sure???'

if [ ${#} -eq 0 ]; then
printf "Usage: \e[100m \e[32mpromptmenu\e[39;100m -y <command> \e[0m\n"
Expand Down
56 changes: 56 additions & 0 deletions .scripts/Rofi/screenshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash

# credits to adi1090x

dir="$HOME/.scripts/Rofi/themes"
rofi_command="rofi -theme $dir/screenshot.rasi"

# Error msg
msg() {
notify-send -u normal "Please install 'scrot' first."
}

# Screenshot directory
ss_dir=${HOME}/Pictures/Screenshots

# Options
screen=""
area=""
window=""
timed=""

# Variable passed to rofi
options="$screen\n$area\n$window\n$timed"

chosen="$(echo -e "$options" | $rofi_command -p '' -dmenu -selected-row 1)"
case $chosen in
$screen)
if [[ -f /usr/bin/scrot ]]; then
sleep 1; scrot $ss_dir/Screenshot_%Y-%m-%d-%S_$wx$h.png && notify-send "Captured" i ~/.icons/monitor.svg
else
msg
fi
;;
$area)
if [[ -f /usr/bin/scrot ]]; then
scrot -s $ss_dir/Screenshot_%Y-%m-%d-%S_$wx$h.png && notify-send "Captured" -i ~/.icons/monitor.svg
else
msg
fi
;;
$window)
if [[ -f /usr/bin/scrot ]]; then
sleep 1; scrot -u ${ss_dir}/Screenshot_%Y-%m-%d-%S_$wx$h.png && notify-send "Captured" -i ~/.icons/monitor.svg
else
msg
fi
;;
$timed)
if [[ -f /usr/bin/scrot ]]; then
scrot -d 3 $ss_dir/Screenshot_%Y-%m-%d-%S_$wx$h.png && notify-send "Captured" -i ~/.icons/monitor.svg
else
msg
fi
;;
esac

19 changes: 0 additions & 19 deletions .scripts/Rofi/themes/colors.rasi

This file was deleted.

74 changes: 0 additions & 74 deletions .scripts/Rofi/themes/five-horizontal.rasi

This file was deleted.

103 changes: 0 additions & 103 deletions .scripts/Rofi/themes/five-vertical.rasi

This file was deleted.

Loading

0 comments on commit d717eed

Please sign in to comment.