Updated my scripts.
This commit is contained in:
parent
7c981ce281
commit
272fb806ef
32
dmenu-dl-manager
Executable file
32
dmenu-dl-manager
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
# script to download a file from that has it's link in clipboard
|
||||
|
||||
# a functions that list all everything in a directory and gives back the chosen one
|
||||
choice (){
|
||||
(ls -1 -a | dmenu -l 30 -p "Choose where to download")
|
||||
}
|
||||
|
||||
# first choice
|
||||
dir=$(choice)
|
||||
|
||||
# while the coice is not a file do what is inside
|
||||
while [ "$dir" != "Here" ]
|
||||
do
|
||||
# first we check if it is a single dot and if it we download there
|
||||
[ "$dir" = "." ] && break
|
||||
|
||||
# if dir is empty we exit
|
||||
[ -z "$dir" ] && exit
|
||||
|
||||
# if all checks are negative we change into the directory
|
||||
cd "$dir"
|
||||
|
||||
# doing a new check
|
||||
dir=$(choice)
|
||||
done
|
||||
|
||||
# download the file
|
||||
quick-notify "Dmenu downloader" "Started downloading a file"
|
||||
aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none "$(xclip -o)"
|
||||
quick-notify "Dmenu downloader" "Downloading finished"
|
@ -8,10 +8,9 @@
|
||||
# cd into the given directory
|
||||
cd $1
|
||||
|
||||
|
||||
# a functions that list all everything in a directory and gives back the chosen one
|
||||
choice (){
|
||||
(ls -1 -a | dmenu -l 30 -p "Choose your file!")
|
||||
(ls -1 -a | dmenu -l 30 -p "Choose your file!")
|
||||
}
|
||||
|
||||
# first choice
|
||||
@ -34,5 +33,5 @@ do
|
||||
done
|
||||
|
||||
# open the file using xdg-open
|
||||
quick-notify "Opening file" "$dir"
|
||||
xdg-open "$dir"
|
||||
quick-notify "Opening file" "$dir"
|
@ -1,11 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# dmenu script to open up my games or game launcher's
|
||||
|
||||
declare -a Games=(
|
||||
"Heroic (Launcher)"
|
||||
"Lutris (Launcher)"
|
||||
)
|
||||
|
||||
case "$(printf "%s\n" "${Games[@]}" | dmenu -p "Choose your game")" in
|
||||
"Heroic (Launcher)") heroic ;;
|
||||
"Heroic (Launcher)") heroic ;;
|
||||
"Lutris (Launcher)") lutris ;;
|
||||
esac
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# a simple "gui" for envycontrol
|
||||
|
||||
already_in()
|
||||
{
|
||||
quick-notify "Gpu Manager" "Already in $new_mode mode"
|
||||
@ -15,9 +17,9 @@ switch()
|
||||
}
|
||||
|
||||
case "$(printf "integrated\\nhybrid\\nnvidia" | dmenu -p "Choose gpu mode")" in
|
||||
"integrated") new_mode="integrated";;
|
||||
"nvidia") new_mode="nvidia";;
|
||||
"hybrid") new_mode="hybrid";;
|
||||
"integrated") new_mode="integrated";;
|
||||
"nvidia") new_mode="nvidia";;
|
||||
"hybrid") new_mode="hybrid";;
|
||||
esac
|
||||
|
||||
current_mode=$(envycontrol.py --status | awk '{ print $5 }')
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# kill those pesky proceses
|
||||
|
||||
selected=$(ps --user "$USER" -F | dmenu -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}')
|
||||
|
||||
[ -n "$selected" ] || exit
|
13
dmenu-link-handler
Executable file
13
dmenu-link-handler
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Feed this script a link or it will get it from your clipboard and it will give dmenu
|
||||
# with some choice of programs to open the link with.
|
||||
|
||||
[ -z "$@" ] && link=$(xclip -o) || link="$@"
|
||||
|
||||
case "$(printf "mpv\\nbrowser\\ncopy url\\nw3m" | dmenu -p "Open link with what program?")" in
|
||||
mpv) "$VIDEO" "$link" ;;
|
||||
browser) "$BROWSER" "$link" > /dev/null;;
|
||||
"copy url") echo "$link" | xclip -selection clipboard ;;
|
||||
w3m) readable "$link" | w3m -T text/html ;;
|
||||
esac
|
8
dmenu-power-menu
Executable file
8
dmenu-power-menu
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# simple power menu script
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
|
||||
"shutdown") systemctl poweroff ;;
|
||||
"reboot") systemctl reboot ;;
|
||||
esac
|
@ -1,12 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# dmenu script to run one of my most runned programs
|
||||
|
||||
declare -a software=(
|
||||
"bitwarden-desktop"
|
||||
"obs"
|
||||
"godot"
|
||||
"megasync"
|
||||
"spotify"
|
||||
"discord"
|
||||
"bitwarden-desktop"
|
||||
"megasync"
|
||||
"spotify"
|
||||
"discord"
|
||||
)
|
||||
|
||||
choice=$(printf "%s\n" "${software[@]}" | dmenu -p "Choose software to run")
|
20
dmenu-ryzenadj
Executable file
20
dmenu-ryzenadj
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# dmenu script for quickly running specific ryzenadj commands
|
||||
|
||||
current_temp=$(sudo /bin/ryzenadj -i | grep 'tctl-temp' | awk '{ print $6 }')
|
||||
slow_time=$(sudo /bin/ryzenadj -i | grep 'slow-time' | awk '{ print $4 }')
|
||||
|
||||
[ "$current_temp" = "60.000" ] && current_mode="normal mode"
|
||||
[ "$current_temp" = "65.000" ] && current_mode="light gaming"
|
||||
[ "$current_temp" = "70.000" ] && current_mode="heavy gaming"
|
||||
[ "$current_temp" = "75.000" ] && current_mode="heavy programs"
|
||||
[ "$current_temp" = "85.000" ] && current_mode="heavy gaming pro"
|
||||
|
||||
case "$(printf "normal mode\\nlight gaming\\nheavy gaming\\nheavy programs\\nheavy gaming pro" | dmenu -p "Current: $current_mode")" in
|
||||
"normal mode") sudo ryzenadj --slow-time=30 --vrmmax-current=30000 --tctl-temp=60 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --power-saving; break ;;
|
||||
"light gaming") sudo ryzenadj --slow-time=30 --vrmmax-current=35000 --tctl-temp=65 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --max-performance; break ;;
|
||||
"heavy gaming") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=70 --stapm-limit=20000 --stapm-time=1000 --fast-limit=25000 --slow-limit=21000 --max-performance; break ;;
|
||||
"heavy programs") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=75 --stapm-limit=25000 --stapm-time=1000 --fast-limit=30000 --slow-limit=27000 --max-performance; break ;;
|
||||
"heavy gaming pro") sudo ryzenadj --slow-time=60 --vrmmax-current=70000 --tctl-temp=85 --stapm-limit=35000 --stapm-time=1000 --fast-limit=50000 --slow-limit=48000 --max-performance; break ;;
|
||||
esac
|
@ -10,5 +10,4 @@ profile=$(ls -1 -A | dmenu -l 30 -p "Choose your file!")
|
||||
|
||||
[ -n "$profile" ] || exit
|
||||
|
||||
quick-notify "Loading profile" "$profile"
|
||||
./$profile
|
16
dmenu-screenshot
Executable file
16
dmenu-screenshot
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# It lets you choose the kind of screenshot to take, including
|
||||
# copying the image or even highlighting an area to copy.
|
||||
|
||||
dir="$HOME/Pictures/screenshots"
|
||||
[ ! -d "$dir" ] && mkdir $dir -p
|
||||
|
||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -p "Screenshot which area?")" in
|
||||
"a selected area") sleep 0.5; maim -s $dir/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"current window") sleep 0.5; maim -i "$(xdotool getactivewindow)" $dir/pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"full screen") sleep 0.5; maim $dir/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"a selected area (copy)") sleep 0.5; maim -s | xclip -selection clipboard -t image/png ;;
|
||||
"current window (copy)") sleep 0.5; maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
|
||||
"full screen (copy)") sleep 0.5; maim | xclip -selection clipboard -t image/png ;;
|
||||
esac
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# a simple dmenu usb managment script
|
||||
|
||||
driveCount(){
|
||||
count="$(echo "$1" | wc -l)"
|
||||
}
|
@ -6,9 +6,9 @@ wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list --rescan yes | sed 1
|
||||
|
||||
connected=$(nmcli -fields WIFI g)
|
||||
if [[ "$connected" =~ "enabled" ]]; then
|
||||
toggle="睊 Disable Wi-Fi"
|
||||
toggle="睊 Disable Wi-Fi"
|
||||
elif [[ "$connected" =~ "disabled" ]]; then
|
||||
toggle="直 Enable Wi-Fi"
|
||||
toggle="直 Enable Wi-Fi"
|
||||
fi
|
||||
|
||||
# Use dmenu to select wifi network
|
||||
@ -17,22 +17,22 @@ chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | dmenu -p "Wi-Fi SSID:
|
||||
chosen_id=$(echo "${chosen_network:3}" | xargs)
|
||||
|
||||
if [ "$chosen_network" = "" ]; then
|
||||
exit
|
||||
exit
|
||||
elif [ "$chosen_network" = "直 Enable Wi-Fi" ]; then
|
||||
nmcli radio wifi on
|
||||
nmcli radio wifi on
|
||||
elif [ "$chosen_network" = "睊 Disable Wi-Fi" ]; then
|
||||
nmcli radio wifi off
|
||||
nmcli radio wifi off
|
||||
else
|
||||
# Message to show when connection is activated successfully
|
||||
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
|
||||
nmcli connection up id "$chosen_id" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||
else
|
||||
if [[ "$chosen_network" =~ "" ]]; then
|
||||
wifi_password=$(dmenu -p "Password: " )
|
||||
fi
|
||||
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||
fi
|
||||
# Message to show when connection is activated successfully
|
||||
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
|
||||
nmcli connection up id "$chosen_id" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||
else
|
||||
if [[ "$chosen_network" =~ "" ]]; then
|
||||
wifi_password=$(dmenu -p "Password: " )
|
||||
fi
|
||||
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||
fi
|
||||
fi
|
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Feed this script a link and it will give dmenu
|
||||
# with some choice of programs to open the link with.
|
||||
|
||||
case "$(printf "mpv\\nbrowser\\ncopy url\\nw3m" | dmenu -p "Open link with what program?")" in
|
||||
mpv) "$VIDEO" "$1" ;;
|
||||
browser) "$BROWSER" "$1" > /dev/null;;
|
||||
"copy url") echo "$1" | xclip -selection clipboard ;;
|
||||
w3m) readable "$1" | w3m -T text/html ;;
|
||||
esac
|
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
|
||||
"shutdown") systemctl poweroff ;;
|
||||
"reboot") systemctl reboot ;;
|
||||
esac
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
current_temp=$(sudo /bin/ryzenadj -i | grep 'tctl-temp' | awk '{ print $6 }')
|
||||
slow_time=$(sudo /bin/ryzenadj -i | grep 'slow-time' | awk '{ print $4 }')
|
||||
|
||||
[ "$current_temp" = "60.000" ] && current_mode="normal mode"
|
||||
[ "$current_temp" = "65.000" ] && current_mode="light gaming"
|
||||
[ "$current_temp" = "70.000" ] && current_mode="heavy gaming"
|
||||
[ "$current_temp" = "75.000" ] && current_mode="heavy programs"
|
||||
[ "$current_temp" = "85.000" ] && current_mode="heavy gaming pro"
|
||||
|
||||
case "$(printf "normal mode\\nlight gaming\\nheavy gaming\\nheavy programs\\nheavy gaming pro" | dmenu -p "Current: $current_mode")" in
|
||||
"normal mode") sudo ryzenadj --slow-time=30 --vrmmax-current=30000 --tctl-temp=60 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --power-saving; break ;;
|
||||
"light gaming") sudo ryzenadj --slow-time=30 --vrmmax-current=35000 --tctl-temp=65 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000 --max-performance; break ;;
|
||||
"heavy gaming") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=70 --stapm-limit=20000 --stapm-time=1000 --fast-limit=25000 --slow-limit=21000 --max-performance; break ;;
|
||||
"heavy programs") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --tctl-temp=75 --stapm-limit=25000 --stapm-time=1000 --fast-limit=30000 --slow-limit=27000 --max-performance; break ;;
|
||||
"heavy gaming pro") sudo ryzenadj --slow-time=60 --vrmmax-current=70000 --tctl-temp=85 --stapm-limit=35000 --stapm-time=1000 --fast-limit=50000 --slow-limit=48000 --max-performance; break ;;
|
||||
esac
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# It lets you
|
||||
# choose the kind of screenshot to take, including copying the image or even
|
||||
# highlighting an area to copy. scrotcucks on suicidewatch right now.
|
||||
|
||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -p "Screenshot which area?")" in
|
||||
"a selected area") sleep 0.5; maim -s $HOME/Pictures/screenshots/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"current window") sleep 0.5; maim -i "$(xdotool getactivewindow)" $HOME/Pictures/screenshots/pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"full screen") sleep 0.5; maim $HOME/Pictures/screenshots/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"a selected area (copy)") sleep 0.5; maim -s | xclip -selection clipboard -t image/png ;;
|
||||
"current window (copy)") sleep 0.5; maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
|
||||
"full screen (copy)") sleep 0.5; maim | xclip -selection clipboard -t image/png ;;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user