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 into the given directory
|
||||||
cd $1
|
cd $1
|
||||||
|
|
||||||
|
|
||||||
# a functions that list all everything in a directory and gives back the chosen one
|
# a functions that list all everything in a directory and gives back the chosen one
|
||||||
choice (){
|
choice (){
|
||||||
(ls -1 -a | dmenu -l 30 -p "Choose your file!")
|
(ls -1 -a | dmenu -l 30 -p "Choose your file!")
|
||||||
}
|
}
|
||||||
|
|
||||||
# first choice
|
# first choice
|
||||||
@ -25,14 +24,14 @@ do
|
|||||||
|
|
||||||
# if dir is empty we exit
|
# if dir is empty we exit
|
||||||
[ -z "$dir" ] && exit
|
[ -z "$dir" ] && exit
|
||||||
|
|
||||||
# if all check are negative we change into the directory
|
# if all check are negative we change into the directory
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
|
|
||||||
# doing a new check
|
# doing a new check
|
||||||
dir=$(choice)
|
dir=$(choice)
|
||||||
done
|
done
|
||||||
|
|
||||||
# open the file using xdg-open
|
# open the file using xdg-open
|
||||||
quick-notify "Opening file" "$dir"
|
|
||||||
xdg-open "$dir"
|
xdg-open "$dir"
|
||||||
|
quick-notify "Opening file" "$dir"
|
@ -1,11 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# dmenu script to open up my games or game launcher's
|
||||||
|
|
||||||
declare -a Games=(
|
declare -a Games=(
|
||||||
"Heroic (Launcher)"
|
"Heroic (Launcher)"
|
||||||
"Lutris (Launcher)"
|
"Lutris (Launcher)"
|
||||||
)
|
)
|
||||||
|
|
||||||
case "$(printf "%s\n" "${Games[@]}" | dmenu -p "Choose your game")" in
|
case "$(printf "%s\n" "${Games[@]}" | dmenu -p "Choose your game")" in
|
||||||
"Heroic (Launcher)") heroic ;;
|
"Heroic (Launcher)") heroic ;;
|
||||||
"Lutris (Launcher)") lutris ;;
|
"Lutris (Launcher)") lutris ;;
|
||||||
esac
|
esac
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# a simple "gui" for envycontrol
|
||||||
|
|
||||||
already_in()
|
already_in()
|
||||||
{
|
{
|
||||||
quick-notify "Gpu Manager" "Already in $new_mode mode"
|
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
|
case "$(printf "integrated\\nhybrid\\nnvidia" | dmenu -p "Choose gpu mode")" in
|
||||||
"integrated") new_mode="integrated";;
|
"integrated") new_mode="integrated";;
|
||||||
"nvidia") new_mode="nvidia";;
|
"nvidia") new_mode="nvidia";;
|
||||||
"hybrid") new_mode="hybrid";;
|
"hybrid") new_mode="hybrid";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
current_mode=$(envycontrol.py --status | awk '{ print $5 }')
|
current_mode=$(envycontrol.py --status | awk '{ print $5 }')
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# kill those pesky proceses
|
||||||
|
|
||||||
selected=$(ps --user "$USER" -F | dmenu -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}')
|
selected=$(ps --user "$USER" -F | dmenu -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}')
|
||||||
|
|
||||||
[ -n "$selected" ] || exit
|
[ -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
|
#!/bin/bash
|
||||||
|
|
||||||
|
# dmenu script to run one of my most runned programs
|
||||||
|
|
||||||
declare -a software=(
|
declare -a software=(
|
||||||
"bitwarden-desktop"
|
"bitwarden-desktop"
|
||||||
"obs"
|
"megasync"
|
||||||
"godot"
|
"spotify"
|
||||||
"megasync"
|
"discord"
|
||||||
"spotify"
|
|
||||||
"discord"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
choice=$(printf "%s\n" "${software[@]}" | dmenu -p "Choose software to run")
|
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
|
[ -n "$profile" ] || exit
|
||||||
|
|
||||||
quick-notify "Loading profile" "$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
|
#!/bin/sh
|
||||||
|
|
||||||
|
# a simple dmenu usb managment script
|
||||||
|
|
||||||
driveCount(){
|
driveCount(){
|
||||||
count="$(echo "$1" | wc -l)"
|
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)
|
connected=$(nmcli -fields WIFI g)
|
||||||
if [[ "$connected" =~ "enabled" ]]; then
|
if [[ "$connected" =~ "enabled" ]]; then
|
||||||
toggle="睊 Disable Wi-Fi"
|
toggle="睊 Disable Wi-Fi"
|
||||||
elif [[ "$connected" =~ "disabled" ]]; then
|
elif [[ "$connected" =~ "disabled" ]]; then
|
||||||
toggle="直 Enable Wi-Fi"
|
toggle="直 Enable Wi-Fi"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use dmenu to select wifi network
|
# 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)
|
chosen_id=$(echo "${chosen_network:3}" | xargs)
|
||||||
|
|
||||||
if [ "$chosen_network" = "" ]; then
|
if [ "$chosen_network" = "" ]; then
|
||||||
exit
|
exit
|
||||||
elif [ "$chosen_network" = "直 Enable Wi-Fi" ]; then
|
elif [ "$chosen_network" = "直 Enable Wi-Fi" ]; then
|
||||||
nmcli radio wifi on
|
nmcli radio wifi on
|
||||||
elif [ "$chosen_network" = "睊 Disable Wi-Fi" ]; then
|
elif [ "$chosen_network" = "睊 Disable Wi-Fi" ]; then
|
||||||
nmcli radio wifi off
|
nmcli radio wifi off
|
||||||
else
|
else
|
||||||
# Message to show when connection is activated successfully
|
# Message to show when connection is activated successfully
|
||||||
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 [[ $(echo "$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
|
||||||
wifi_password=$(dmenu -p "Password: " )
|
wifi_password=$(dmenu -p "Password: " )
|
||||||
fi
|
fi
|
||||||
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||||
fi
|
fi
|
||||||
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