Updated scripts.
This commit is contained in:
parent
272fb806ef
commit
8364d66ca5
@ -10,6 +10,8 @@ declare -a configs=(
|
||||
"bspwm - $HOME/.config/bspwm/bspwmrc"
|
||||
"bspwm autostart - $HOME/Bin/bspwm/autorun.sh"
|
||||
"dunst - $HOME/.config/dunst/dunstrc"
|
||||
"game-run - $HOME/.config/game-run/config.ini"
|
||||
"kitty - $HOME/.config/kitty/kitty.conf"
|
||||
"lf - $HOME/.config/lf/lfrc"
|
||||
"sxhkd - $HOME/.config/sxhkd/sxhkdrc"
|
||||
"neovim - $HOME/.config/nvim/init.lua"
|
||||
@ -23,6 +25,7 @@ declare -a configs=(
|
||||
"zshenv - $HOME/.zshenv"
|
||||
"zshrc - $HOME/.zshenv"
|
||||
"xinitrc - $HOME/.xinitrc"
|
||||
"qtile - $HOME/.config/qtile/config.py"
|
||||
)
|
||||
|
||||
choice=$(printf '%s\n' "${configs[@]}" | dmenu -l 10 -p 'Edit config:')
|
||||
|
14
dmenu-games
14
dmenu-games
@ -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=(
|
||||
"Heroic (Launcher)"
|
||||
"Lutris (Launcher)"
|
||||
)
|
||||
choice=$(game-run | dmenu -p "Choose game to run:")
|
||||
|
||||
case "$(printf "%s\n" "${Games[@]}" | dmenu -p "Choose your game")" in
|
||||
"Heroic (Launcher)") heroic ;;
|
||||
"Lutris (Launcher)") lutris ;;
|
||||
esac
|
||||
game-run "$choice"
|
||||
|
43
dmenu-gpu
43
dmenu-gpu
@ -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
6
dmenu-pass
Executable 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
|
@ -3,6 +3,6 @@
|
||||
# simple power menu script
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
|
||||
"shutdown") systemctl poweroff ;;
|
||||
"reboot") systemctl reboot ;;
|
||||
"shutdown") sudo poweroff ;;
|
||||
"reboot") sudo reboot ;;
|
||||
esac
|
||||
|
@ -3,7 +3,7 @@
|
||||
# a simple dmenu usb managment script
|
||||
|
||||
driveCount(){
|
||||
count="$(echo "$1" | wc -l)"
|
||||
count="$(printf '%s\n' "$1" | wc -l)"
|
||||
}
|
||||
|
||||
mount(){
|
||||
@ -18,6 +18,7 @@ mount(){
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
udisksctl mount -b "${chosen%% *}"
|
||||
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} mounted"
|
||||
else
|
||||
quick-notify "Dmenu Usb Manager" "No drives chosen to mount"
|
||||
exit
|
||||
@ -33,10 +34,11 @@ unmount(){
|
||||
exit
|
||||
fi
|
||||
|
||||
chosen="$(printf '%s' "$mounted" | dmenu -p "Drive to unmount?")"
|
||||
chosen="$(printf "$mounted" | dmenu -p "Drive to unmount?")"
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
udisksctl unmount -b "${chosen%% *}"
|
||||
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} unmounted"
|
||||
else
|
||||
quick-notify "Dmenu Usb Manager" "No drives chosen to unmount"
|
||||
exit
|
||||
|
@ -12,9 +12,9 @@ elif [[ "$connected" =~ "disabled" ]]; then
|
||||
fi
|
||||
|
||||
# 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
|
||||
chosen_id=$(echo "${chosen_network:3}" | xargs)
|
||||
chosen_id=$(printf '%s\n' "${chosen_network:3}" | xargs)
|
||||
|
||||
if [ "$chosen_network" = "" ]; then
|
||||
exit
|
||||
@ -27,7 +27,7 @@ else
|
||||
success_message="You are now connected to the Wi-Fi network \"$chosen_id\"."
|
||||
# Get saved connections
|
||||
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"
|
||||
else
|
||||
if [[ "$chosen_network" =~ "" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user