WIP new top level flakes break down
This commit is contained in:
parent
2238aaf367
commit
7215fd37bf
57 changed files with 3033 additions and 69 deletions
14
flakes/hyprland/home_manager/scripts/confirm-action.sh
Executable file
14
flakes/hyprland/home_manager/scripts/confirm-action.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
COMMAND_TO_RUN="$1"
|
||||
PROMPT_MESSAGE="$2"
|
||||
|
||||
if [ -z "$PROMPT_MESSAGE" ]; then
|
||||
PROMPT_MESSAGE="Are you sure?"
|
||||
fi
|
||||
|
||||
choice=$(echo -e "No\nYes" | wofi --dmenu --location center -p "$PROMPT_MESSAGE")
|
||||
|
||||
if [ "$choice" == "Yes" ]; then
|
||||
eval "$COMMAND_TO_RUN"
|
||||
fi
|
||||
6
flakes/hyprland/home_manager/scripts/toggle-airplane-mode.sh
Executable file
6
flakes/hyprland/home_manager/scripts/toggle-airplane-mode.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
if [ "$(nmcli radio all)" = "enabled" ]; then
|
||||
nmcli radio all off
|
||||
else
|
||||
nmcli radio all on
|
||||
fi
|
||||
6
flakes/hyprland/home_manager/scripts/toggle-power-profile.sh
Executable file
6
flakes/hyprland/home_manager/scripts/toggle-power-profile.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
if [ "$(powerprofilesctl get)" = "performance" ]; then
|
||||
powerprofilesctl set balanced
|
||||
else
|
||||
powerprofilesctl set performance
|
||||
fi
|
||||
21
flakes/hyprland/home_manager/scripts/wofi-bluetooth-menu.sh
Executable file
21
flakes/hyprland/home_manager/scripts/wofi-bluetooth-menu.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
devices=$(bluetoothctl devices | awk '{print $2, $3}')
|
||||
|
||||
if [ -z "$devices" ]; then
|
||||
options=" Power On\n Scan for devices"
|
||||
else
|
||||
options="$devices\n Power Off\n Scan for devices"
|
||||
fi
|
||||
|
||||
chosen=$(echo -e "$options" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Bluetooth")
|
||||
|
||||
case "$chosen" in
|
||||
" Power On") bluetoothctl power on;;
|
||||
" Power Off") bluetoothctl power off;;
|
||||
" Scan for devices") bluetoothctl scan on;;
|
||||
*)
|
||||
mac=$(echo "$chosen" | awk '{print $1}')
|
||||
bluetoothctl connect "$mac"
|
||||
;;
|
||||
esac
|
||||
24
flakes/hyprland/home_manager/scripts/wofi-wifi-menu.sh
Executable file
24
flakes/hyprland/home_manager/scripts/wofi-wifi-menu.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Get a list of available Wi-Fi networks
|
||||
nets=$(nmcli --terse --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 's/\\:/__/g')
|
||||
|
||||
# Get the current connection status
|
||||
connected_ssid=$(nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d: -f2)
|
||||
|
||||
if [[ ! -z "$connected_ssid" ]]; then
|
||||
toggle=" Toggle Wi-Fi Off"
|
||||
else
|
||||
toggle=" Toggle Wi-Fi On"
|
||||
fi
|
||||
|
||||
# Present the menu to the user
|
||||
chosen_network=$(echo -e "$toggle\n$nets" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Wi-Fi Networks")
|
||||
|
||||
# Perform an action based on the user's choice
|
||||
if [ "$chosen_network" = "$toggle" ]; then
|
||||
nmcli radio wifi $([ "$connected_ssid" = "" ] && echo "on" || echo "off")
|
||||
elif [ ! -z "$chosen_network" ]; then
|
||||
ssid=$(echo "$chosen_network" | sed 's/__/\\:/g' | awk -F' ' '{print $1}')
|
||||
nmcli device wifi connect "$ssid"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue