updated
This commit is contained in:
parent
4be5494d9d
commit
f7fa1a14fe
5 changed files with 42 additions and 41 deletions
|
@ -191,7 +191,7 @@ print_status() {
|
||||||
paired_devices_cmd="paired-devices"
|
paired_devices_cmd="paired-devices"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mapfile -t paired_devices < <(bluetoothctl $paired_devices_cmd | grep Device | cut -d ' ' -f 2)
|
mapfile -t paired_devices < <(bluetoothctl "$paired_devices_cmd" | grep Device | cut -d ' ' -f 2)
|
||||||
counter=0
|
counter=0
|
||||||
|
|
||||||
for device in "${paired_devices[@]}"; do
|
for device in "${paired_devices[@]}"; do
|
||||||
|
|
|
@ -2,9 +2,12 @@
|
||||||
|
|
||||||
# ***This script was made by Clay Gomera (Drake)***
|
# ***This script was made by Clay Gomera (Drake)***
|
||||||
# - Description: A simple power menu rofi script
|
# - Description: A simple power menu rofi script
|
||||||
# - Dependencies: rofi, power-profiles-daemon
|
# - Dependencies: rofi, power-profiles-daemon, swaylock
|
||||||
#
|
#
|
||||||
|
|
||||||
|
## MENU PROMPT ##
|
||||||
|
menu="rofi -dmenu -i -p"
|
||||||
|
|
||||||
## CURRENT WALLPAPER FOR LOCKSCREEN ##
|
## CURRENT WALLPAPER FOR LOCKSCREEN ##
|
||||||
currwall=$(tail --l 1 "$HOME/.wbg" | awk '{print $5}')
|
currwall=$(tail --l 1 "$HOME/.wbg" | awk '{print $5}')
|
||||||
|
|
||||||
|
@ -16,8 +19,6 @@ option4="鈴 Suspend"
|
||||||
option5=" Lock"
|
option5=" Lock"
|
||||||
option6=" Change power profile"
|
option6=" Change power profile"
|
||||||
option7=" Cancel"
|
option7=" Cancel"
|
||||||
|
|
||||||
## OPTIONS ARRAY ##
|
|
||||||
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
|
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
|
||||||
|
|
||||||
## POWER PROFILE OPTIONS ##
|
## POWER PROFILE OPTIONS ##
|
||||||
|
@ -25,12 +26,10 @@ pwr1=" Performance"
|
||||||
pwr2=" Balanced"
|
pwr2=" Balanced"
|
||||||
pwr3=" Power Saver"
|
pwr3=" Power Saver"
|
||||||
pwr4=" Cancel"
|
pwr4=" Cancel"
|
||||||
|
|
||||||
## POWER PROFILES ARRAY ##
|
|
||||||
pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
|
pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
|
||||||
|
|
||||||
## MAIN ACTION COMMAND ##
|
## MAIN ACTION COMMAND ##
|
||||||
action=$(echo -e "$options" | rofi -dmenu -i -p " Power Options ")
|
action=$(echo -e "$options" | $menu " Power Options ")
|
||||||
case "$action" in
|
case "$action" in
|
||||||
$option1*)
|
$option1*)
|
||||||
pkill Hyprland;;
|
pkill Hyprland;;
|
||||||
|
@ -53,7 +52,7 @@ case "$action" in
|
||||||
elif [ "$currentpwr" = "balanced" ]; then
|
elif [ "$currentpwr" = "balanced" ]; then
|
||||||
currentpwr=" Balanced"
|
currentpwr=" Balanced"
|
||||||
fi
|
fi
|
||||||
pwraction=$(echo -e "$pwrs" | rofi -dmenu -i -p " Power Profile Menu - Currently set to: ${currentpwr} ")
|
pwraction=$(echo -e "$pwrs" | $menu " Power Profile Menu - Currently set to: ${currentpwr} ")
|
||||||
case "$pwraction" in
|
case "$pwraction" in
|
||||||
$pwr1*)
|
$pwr1*)
|
||||||
powerprofilesctl set performance && notify-send "Power profile switched to performance";;
|
powerprofilesctl set performance && notify-send "Power profile switched to performance";;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Screenshot directory
|
# Screenshot directory
|
||||||
screenshot_directory="$HOME/Pictures/Screenshots"
|
screenshot_directory="$HOME/Pictures/Screenshots"
|
||||||
mkdir -p $screenshot_directory
|
mkdir -p "$screenshot_directory"
|
||||||
|
|
||||||
countdown() {
|
countdown() {
|
||||||
notify-send "Screenshot" "Executing in 3 seconds" -t 1000
|
notify-send "Screenshot" "Executing in 3 seconds" -t 1000
|
||||||
|
@ -48,7 +48,7 @@ get_options() {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_deps() {
|
check_deps() {
|
||||||
if ! hash $1 2>/dev/null; then
|
if ! hash "$1" 2>/dev/null; then
|
||||||
echo "Error: This script requires $1"
|
echo "Error: This script requires $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -108,7 +108,7 @@ main() {
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
main $1 &
|
main "$1" &
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
|
@ -2,52 +2,52 @@
|
||||||
|
|
||||||
# ***This script was made by Clay Gomera (Drake)***
|
# ***This script was made by Clay Gomera (Drake)***
|
||||||
# - Description: A simple wallpaper changer script
|
# - Description: A simple wallpaper changer script
|
||||||
# - Dependencies: rofi, fd, feh
|
# - Dependencies: rofi, fd, swaybg
|
||||||
|
|
||||||
## MAIN VARIABLES AND COMMANDS ##
|
## MENU PROMPT ##
|
||||||
walldir="$HOME/Pictures/Wallpapers" # wallpapers folder, change it to yours, make sure that it ends with a /
|
menu="rofi -dmenu -i -p"
|
||||||
cd "$walldir" || exit
|
|
||||||
|
|
||||||
## SELECT PICTURE FUNCTION ##
|
## WALLPAPER DIRECTORY ##
|
||||||
selectpic() {
|
walldir="$HOME/Pictures/Wallpapers" # wallpapers folder, change it to yours
|
||||||
wallpaper=$(fd -p "$walldir" | rofi -dmenu -i -p " Wallpaper Selector ")
|
|
||||||
if [ "$wallpaper" ]; then
|
|
||||||
chosenwall=$wallpaper
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
selectpic
|
|
||||||
|
|
||||||
## WALLPAPER SETTING OPTIONS ##
|
## WALLPAPER SETTING OPTIONS ##
|
||||||
option1=" Fill"
|
option1=" Fill"
|
||||||
option2=" Center"
|
option2=" Center"
|
||||||
option3=" Tile"
|
option3=" Tile"
|
||||||
option4=" Fit"
|
option4=" Fit"
|
||||||
options="$option1\n$option2\n$option3\n$option4\n$option5"
|
options="$option1\n$option2\n$option3\n$option4"
|
||||||
|
|
||||||
|
## SELECT PICTURE ##
|
||||||
|
cd "$walldir" || exit 1
|
||||||
|
wallpaper=$(fd -p "$walldir" | $menu " Wallpaper Selector ")
|
||||||
|
if [ "$wallpaper" ]; then
|
||||||
|
chosenwall=$wallpaper
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
## MAIN ACTION ##
|
## MAIN ACTION ##
|
||||||
action=$(echo -e "$options" | rofi -dmenu -i -p " Chose the format ")
|
action=$(echo -e "$options" | $menu " Chose the format ")
|
||||||
case "$action" in
|
case "$action" in
|
||||||
$option1*)
|
$option1*)
|
||||||
pkill swaybg
|
pkill swaybg
|
||||||
swaybg -m fill -i "$chosenwall" &
|
swaybg -m fill -i "$chosenwall" &
|
||||||
echo -e "#!/bin/sh\nswaybg -m fill -i" $walldir/$chosenwall > "$HOME/.wbg"
|
echo -e "#!/bin/sh\nswaybg -m fill -i $walldir/$chosenwall" > "$HOME/.wbg"
|
||||||
chmod +x "$HOME/.wbg";;
|
chmod +x "$HOME/.wbg";;
|
||||||
$option2*)
|
$option2*)
|
||||||
pkill swaybg
|
pkill swaybg
|
||||||
swaybg -m center -i "$chosenwall" &
|
swaybg -m center -i "$chosenwall" &
|
||||||
echo -e "#!/bin/sh\nswaybg -m center -i" $walldir/$chosenwall > "$HOME/.wbg"
|
echo -e "#!/bin/sh\nswaybg -m center -i $walldir/$chosenwall" > "$HOME/.wbg"
|
||||||
chmod +x "$HOME/.wbg";;
|
chmod +x "$HOME/.wbg";;
|
||||||
$option3*)
|
$option3*)
|
||||||
pkill swaybg
|
pkill swaybg
|
||||||
swaybg -m tile -i "$chosenwall" &
|
swaybg -m tile -i "$chosenwall" &
|
||||||
echo -e "#!/bin/sh\nswaybg -m tile -i" $walldir/$chosenwall > "$HOME/.wbg"
|
echo -e "#!/bin/sh\nswaybg -m tile -i $walldir/$chosenwall" > "$HOME/.wbg"
|
||||||
chmod +x "$HOME/.wbg";;
|
chmod +x "$HOME/.wbg";;
|
||||||
$option4*)
|
$option4*)
|
||||||
pkill swaybg
|
pkill swaybg
|
||||||
swaybg -m fit -i "$chosenwall" &
|
swaybg -m fit -i "$chosenwall" &
|
||||||
echo -e "#!/bin/sh\nswaybg -m fit -i" $walldir/$chosenwall > "$HOME/.wbg"
|
echo -e "#!/bin/sh\nswaybg -m fit -i $walldir/$chosenwall" > "$HOME/.wbg"
|
||||||
chmod +x "$HOME/.wbg";;
|
chmod +x "$HOME/.wbg";;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
# ***This script was made by Clay Gomera (Drake)***
|
# ***This script was made by Clay Gomera (Drake)***
|
||||||
# - Description: A simple wifi rofi script
|
# - Description: A simple wifi rofi script
|
||||||
# - Dependencies: rofi, NetworkManager
|
# - Dependencies: rofi, NetworkManager, io.elementary.capnet-assist
|
||||||
|
|
||||||
## ROFI VARIABLES ##
|
## MENU PROMPT ##
|
||||||
ROFI="rofi -dmenu -i -p"
|
menu="rofi -dmenu -i -p"
|
||||||
|
|
||||||
## MAIN OPTIONS ##
|
## MAIN OPTIONS ##
|
||||||
option1=" Turn on WiFi"
|
option1=" Turn on WiFi"
|
||||||
|
@ -16,7 +16,9 @@ option5=" Setup captive portal"
|
||||||
option6=" Cancel"
|
option6=" Cancel"
|
||||||
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
|
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
|
||||||
|
|
||||||
|
## GRAB WIFI INTERFACE ##
|
||||||
wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)
|
wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)
|
||||||
|
|
||||||
## TURN OFF WIFI FUNCTION ##
|
## TURN OFF WIFI FUNCTION ##
|
||||||
turnoff() {
|
turnoff() {
|
||||||
nmcli radio wifi off
|
nmcli radio wifi off
|
||||||
|
@ -43,12 +45,12 @@ disconnect() {
|
||||||
connect() {
|
connect() {
|
||||||
notify-send "Scannig networks, please wait"
|
notify-send "Scannig networks, please wait"
|
||||||
sleep 1
|
sleep 1
|
||||||
bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | $ROFI " Select a Wifi Network " | cut -d' ' -f1)
|
bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | $menu " Select a Wifi Network " | cut -d' ' -f1)
|
||||||
}
|
}
|
||||||
|
|
||||||
## SELECT PASSWORD FUNCTION ##
|
## SELECT PASSWORD FUNCTION ##
|
||||||
password() {
|
password() {
|
||||||
pass=$(echo " " | $ROFI " Enter Password " -password)
|
pass=$(echo " " | $menu " Enter Password " -password)
|
||||||
}
|
}
|
||||||
|
|
||||||
## MAIN CONNECTION COMMAND ##
|
## MAIN CONNECTION COMMAND ##
|
||||||
|
@ -69,7 +71,7 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
## MAIN ACTION COMMANDS ##
|
## MAIN ACTION COMMANDS ##
|
||||||
cases=$(echo -e "$options" | $ROFI " Wifi Settings " )
|
cases=$(echo -e "$options" | $menu " Wifi Settings " )
|
||||||
case "$cases" in
|
case "$cases" in
|
||||||
$option1*)
|
$option1*)
|
||||||
turnon;;
|
turnon;;
|
||||||
|
|
Loading…
Reference in a new issue