Updated scripts.

This commit is contained in:
cronyakatsuki 2022-04-22 12:48:51 +02:00
parent 272fb806ef
commit 8364d66ca5
7 changed files with 22 additions and 60 deletions

View File

@ -10,6 +10,8 @@ declare -a configs=(
"bspwm - $HOME/.config/bspwm/bspwmrc" "bspwm - $HOME/.config/bspwm/bspwmrc"
"bspwm autostart - $HOME/Bin/bspwm/autorun.sh" "bspwm autostart - $HOME/Bin/bspwm/autorun.sh"
"dunst - $HOME/.config/dunst/dunstrc" "dunst - $HOME/.config/dunst/dunstrc"
"game-run - $HOME/.config/game-run/config.ini"
"kitty - $HOME/.config/kitty/kitty.conf"
"lf - $HOME/.config/lf/lfrc" "lf - $HOME/.config/lf/lfrc"
"sxhkd - $HOME/.config/sxhkd/sxhkdrc" "sxhkd - $HOME/.config/sxhkd/sxhkdrc"
"neovim - $HOME/.config/nvim/init.lua" "neovim - $HOME/.config/nvim/init.lua"
@ -23,6 +25,7 @@ declare -a configs=(
"zshenv - $HOME/.zshenv" "zshenv - $HOME/.zshenv"
"zshrc - $HOME/.zshenv" "zshrc - $HOME/.zshenv"
"xinitrc - $HOME/.xinitrc" "xinitrc - $HOME/.xinitrc"
"qtile - $HOME/.config/qtile/config.py"
) )
choice=$(printf '%s\n' "${configs[@]}" | dmenu -l 10 -p 'Edit config:') choice=$(printf '%s\n' "${configs[@]}" | dmenu -l 10 -p 'Edit config:')

View File

@ -1,13 +1,7 @@
#!/bin/bash #!/bin/sh
# dmenu script to open up my games or game launcher's # dmenu script to open up my games
declare -a Games=( choice=$(game-run | dmenu -p "Choose game to run:")
"Heroic (Launcher)"
"Lutris (Launcher)"
)
case "$(printf "%s\n" "${Games[@]}" | dmenu -p "Choose your game")" in game-run "$choice"
"Heroic (Launcher)") heroic ;;
"Lutris (Launcher)") lutris ;;
esac

View File

@ -1,43 +0,0 @@
#!/bin/sh
# a simple "gui" for envycontrol
already_in()
{
quick-notify "Gpu Manager" "Already in $new_mode mode"
}
switch()
{
if sudo envycontrol.py --switch $new_mode; then
quick-notify "Gpu Manager" "Switched to $new_mode mode"
else
quick-notify "Gpu Manager" "Failed to switch to $new_mode mode"
fi
}
case "$(printf "integrated\\nhybrid\\nnvidia" | dmenu -p "Choose gpu mode")" in
"integrated") new_mode="integrated";;
"nvidia") new_mode="nvidia";;
"hybrid") new_mode="hybrid";;
esac
current_mode=$(envycontrol.py --status | awk '{ print $5 }')
if [ $current_mode = "integrated" ]; then
case $new_mode in
"integrated") already_in;;
"nvidia") quick-notify "Gpu Manager" "You need to first reboot into hybrid mode";;
"hybrid") switch;;
esac
elif [ $current_mode = "hybrid" ]; then
case $new_mode in
"hybrid") already_in;;
*) switch;;
esac
elif [ $current_mode = "nvidia" ]; then
case $new_mode in
"nvidia") already_in;;
*) switch;;
esac
fi

6
dmenu-pass Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# This script is the SUDO_ASKPASS variable, meaning that it will be used as a
# password prompt if needed.
dmenu -P -p "$1" <&- && echo

View File

@ -3,6 +3,6 @@
# simple power menu script # simple power menu script
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
"shutdown") systemctl poweroff ;; "shutdown") sudo poweroff ;;
"reboot") systemctl reboot ;; "reboot") sudo reboot ;;
esac esac

View File

@ -3,7 +3,7 @@
# a simple dmenu usb managment script # a simple dmenu usb managment script
driveCount(){ driveCount(){
count="$(echo "$1" | wc -l)" count="$(printf '%s\n' "$1" | wc -l)"
} }
mount(){ mount(){
@ -18,6 +18,7 @@ mount(){
if [ -n "$chosen" ];then if [ -n "$chosen" ];then
udisksctl mount -b "${chosen%% *}" udisksctl mount -b "${chosen%% *}"
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} mounted"
else else
quick-notify "Dmenu Usb Manager" "No drives chosen to mount" quick-notify "Dmenu Usb Manager" "No drives chosen to mount"
exit exit
@ -33,10 +34,11 @@ unmount(){
exit exit
fi fi
chosen="$(printf '%s' "$mounted" | dmenu -p "Drive to unmount?")" chosen="$(printf "$mounted" | dmenu -p "Drive to unmount?")"
if [ -n "$chosen" ];then if [ -n "$chosen" ];then
udisksctl unmount -b "${chosen%% *}" udisksctl unmount -b "${chosen%% *}"
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} unmounted"
else else
quick-notify "Dmenu Usb Manager" "No drives chosen to unmount" quick-notify "Dmenu Usb Manager" "No drives chosen to unmount"
exit exit

View File

@ -12,9 +12,9 @@ elif [[ "$connected" =~ "disabled" ]]; then
fi fi
# Use dmenu to select wifi network # Use dmenu to select wifi network
chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | dmenu -p "Wi-Fi SSID: " ) chosen_network=$(printf '%s\n%s' "$toggle" "$wifi_list" | uniq -u | dmenu -p "Wi-Fi SSID: " )
# Get name of connection # Get name of connection
chosen_id=$(echo "${chosen_network:3}" | xargs) chosen_id=$(printf '%s\n' "${chosen_network:3}" | xargs)
if [ "$chosen_network" = "" ]; then if [ "$chosen_network" = "" ]; then
exit exit
@ -27,7 +27,7 @@ else
success_message="You are now connected to the Wi-Fi network \"$chosen_id\"." success_message="You are now connected to the Wi-Fi network \"$chosen_id\"."
# Get saved connections # Get saved connections
saved_connections=$(nmcli -g NAME connection) saved_connections=$(nmcli -g NAME connection)
if [[ $(echo "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then if [[ $(printf '%s\n' "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then
nmcli connection up id "$chosen_id" | grep "successfully" && quick-notify "Connection Established" "$success_message" nmcli connection up id "$chosen_id" | grep "successfully" && quick-notify "Connection Established" "$success_message"
else else
if [[ "$chosen_network" =~ "" ]]; then if [[ "$chosen_network" =~ "" ]]; then