Upload from GitHub
This commit is contained in:
5
general/configs/rofi/scripts/emoji
Executable file
5
general/configs/rofi/scripts/emoji
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR="$HOME/.config"
|
||||
|
||||
rofi -show emoji -modi emoji -theme $DIR/rofi/Themes/emojis.rasi
|
98
general/configs/rofi/scripts/powermenu.sh
Executable file
98
general/configs/rofi/scripts/powermenu.sh
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
dir="$HOME/.config/rofi/styles"
|
||||
rofi_command="rofi -theme $dir/five.rasi"
|
||||
|
||||
uptime=$(uptime -p | sed -e 's/up //g')
|
||||
|
||||
# Options
|
||||
shutdown=""
|
||||
reboot=""
|
||||
lock=""
|
||||
suspend=""
|
||||
logout=""
|
||||
|
||||
# Confirmation
|
||||
confirm_exit() {
|
||||
rofi -dmenu\
|
||||
-i\
|
||||
-no-fixed-num-lines\
|
||||
-p "Are You Sure? : "\
|
||||
-theme $dir/confirm.rasi
|
||||
}
|
||||
|
||||
# Message
|
||||
msg() {
|
||||
rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
|
||||
}
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$shutdown\n$reboot\n$lock\n$suspend\n$logout"
|
||||
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 2)"
|
||||
case $chosen in
|
||||
$shutdown)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
loginctl poweroff
|
||||
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$reboot)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
loginctl reboot
|
||||
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$lock)
|
||||
if [[ -f /usr/bin/i3lock ]]; then
|
||||
i3lock
|
||||
elif [[ -f /usr/bin/betterlockscreen ]]; then
|
||||
betterlockscreen -l
|
||||
fi
|
||||
;;
|
||||
$suspend)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
loginctl suspend
|
||||
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
$logout)
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
if [[ "$DESKTOP_SESSION" == "/usr/share/xsessions/voidwm" ]]; then
|
||||
pkill dwm
|
||||
elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then
|
||||
bspc quit
|
||||
elif [[ "$DESKTOP_SESSION" == "/usr/share/xsessions/i3" ]]; then
|
||||
i3-msg exit
|
||||
elif [[ "$DESKTOP_SESSION" == "/usr/local/bin/dwm" ]]; then
|
||||
pkill dwm
|
||||
elif [[ "$DESKTOP_SESSION" == "awesome" ]]; then
|
||||
pkill awesome
|
||||
else
|
||||
pkill Hyprland
|
||||
fi
|
||||
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
;;
|
||||
esac
|
31
general/configs/rofi/scripts/screenshot-wl.sh
Executable file
31
general/configs/rofi/scripts/screenshot-wl.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
dir="$HOME/.config/rofi/styles"
|
||||
rofi_command="rofi -theme $dir/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 0.4; grim -t png - | wl-copy -t image/png
|
||||
;;
|
||||
$area)
|
||||
grim -g "$(slurp)" -t png - | wl-copy -t image/png
|
||||
;;
|
||||
$window)
|
||||
sleep 0.4; grim -g "$(hyprctl activewindow | grep at: | cut -d' ' -f2) $(hyprctl activewindow | grep size: | cut -d' ' -f2 | sed 's/,/x/g')" - | wl-copy
|
||||
;;
|
||||
esac
|
||||
|
31
general/configs/rofi/scripts/screenshot.sh
Executable file
31
general/configs/rofi/scripts/screenshot.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
dir="$HOME/.config/rofi/styles"
|
||||
rofi_command="rofi -theme $dir/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)
|
||||
scrot -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
|
||||
;;
|
||||
$area)
|
||||
scrot -s --line mode=edge -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
|
||||
;;
|
||||
$window)
|
||||
scrot -u -e 'xclip -selection clipboard -target image/png -i $f && rm $f'
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user