Adding my scripts.

This commit is contained in:
CronyAkatsuki 2021-03-13 18:09:41 +01:00
parent 6f51cebd29
commit 9e3b9cc441
7 changed files with 78 additions and 0 deletions

25
README.md Normal file
View File

@ -0,0 +1,25 @@
# Welcome to my dmenu scripts repository
## dmenufilehandler
A very simple script that uses the **find** command to list all the file and diretory's in a given path. After selecting one of the files or directory it will open it in your preferred program using xdg-open.
> example
~~~
dmenufilehandler ~/Videos/Anime
~~~
## dmenulinkhandler
A script that uses case to let you choose from a set of programs to open a link that you want in the desired one. Used in my newsboat config.
Programs used in this script are **mpv**, environmental variable **BROWSER**, copying url using xclip and opening the url using w3m.
> example
~~~
dmenulinkhandler gnu.org
~~~

7
dmenufilehandler Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# feed the script with your directory path
# and it will list all your files and open them
# in your prefered program with xdg-open
find "$1" | dmenu -l 30 | xargs -I {} xdg-open "{}"

11
dmenulinkhandler Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
# Feed this script a link and it will give dmenu
# some choice programs to use to open it.
case "$(printf "mpv\\nbrowser\\ncopy url\\nw3m" | dmenu -p "Open link with what program?")" in
mpv) mpv -quiet "$1" ;;
browser) "$BROWSER" "$1" > /dev/null;;
"copy url") echo "$1" | xclip -selection clipboard ;;
w3m) w3m "$1";;
esac

6
dmenupass 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 "$1" <&- && echo

6
dmenupowermenu Executable file
View File

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

9
dmenuryzenadj Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
case "$(printf "normal mode\\nfluff mode\\nlight gaming\\nheavy gaming\\nsuper heavy programs" | dmenu -p "Choose Ryzen 5 mode")" in
"normal mode") sudo ryzenadj --slow-time=30 --vrmmax-current=30000 --max-gfxclk=900 --max-fclk-frequency=1200 --tctl-temp=60 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000; break ;;
"fluff mode") sudo ryzenadj --slow-time=30 --vrmmax-current=30000 --max-gfxclk=550 --max-fclk-frequency=1200 --tctl-temp=70 --stapm-limit=5000 --stapm-time=150 --fast-limit=7000 --slow-limit=6000; break ;;
"light gaming") sudo ryzenadj --slow-time=30 --vrmmax-current=35000 --max-gfxclk=900 --max-fclk-frequency=1200 --tctl-temp=65 --stapm-limit=10000 --stapm-time=300 --fast-limit=12000 --slow-limit=11000; break ;;
"heavy gaming") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --max-gfxclk=900 --max-fclk-frequency=1200 --tctl-temp=70 --stapm-limit=20000 --stapm-time=1000 --fast-limit=25000 --slow-limit=21000; break ;;
"super heavy programs") sudo ryzenadj --slow-time=60 --vrmmax-current=60000 --max-gfxclk=900 --max-fclk-frequency=1200 --tctl-temp=75 --stapm-limit=25000 --stapm-time=1000 --fast-limit=30000 --slow-limit=27000; break ;;
esac

14
dmenuscreenshot Executable file
View File

@ -0,0 +1,14 @@
#!/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