Updated my scripts.

This commit is contained in:
cronyakatsuki 2022-04-05 16:59:13 +02:00
parent 7c981ce281
commit 272fb806ef
17 changed files with 128 additions and 82 deletions

32
dmenu-dl-manager Executable file
View 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"

View File

@ -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"

View File

@ -1,5 +1,7 @@
#!/bin/bash
# dmenu script to open up my games or game launcher's
declare -a Games=(
"Heroic (Launcher)"
"Lutris (Launcher)"

View File

@ -1,5 +1,7 @@
#!/bin/sh
# a simple "gui" for envycontrol
already_in()
{
quick-notify "Gpu Manager" "Already in $new_mode mode"

View File

@ -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
View 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
View 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

View File

@ -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
View 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

View File

@ -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
View 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

View File

@ -1,5 +1,7 @@
#!/bin/sh
# a simple dmenu usb managment script
driveCount(){
count="$(echo "$1" | wc -l)"
}

View File

@ -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

View File

@ -1,6 +0,0 @@
#!/bin/sh
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
"shutdown") systemctl poweroff ;;
"reboot") systemctl reboot ;;
esac

View File

@ -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

View File

@ -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