Update formatting.

This commit is contained in:
CronyAkatsuki 2023-11-04 22:03:43 +01:00
parent 41754e8ad1
commit e1c508c53b
16 changed files with 287 additions and 278 deletions

View File

@ -6,6 +6,6 @@
[ "$1" = "open" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Open bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r buku --nostdin -o [ "$1" = "open" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Open bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r buku --nostdin -o
[ "$1" = "edit" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r $TERMINAL -e buku -w [ "$1" = "edit" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r "$TERMINAL" -e buku -w
[ "$1" = "delete" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r -I % buku --nostdin -d % --tacit && notify-send "Deleted bookmark" [ "$1" = "delete" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Delete bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r -I % buku --nostdin -d % --tacit

View File

@ -26,11 +26,11 @@ declare -a configs=(
"xinitrc - $HOME/.config/X11/xinitrc" "xinitrc - $HOME/.config/X11/xinitrc"
) )
load_config () { load_config() {
source $HOME/.config/dmenu/config source $HOME/.config/dmenu/config
} }
main () { main() {
load_config load_config
choice=$(printf '%s\n' "${configs[@]}" | $DMENU -l 10 -p 'Edit config:') choice=$(printf '%s\n' "${configs[@]}" | $DMENU -l 10 -p 'Edit config:')

View File

@ -1,19 +1,18 @@
#!/bin/sh #!/bin/sh
# dmenu script to open up my games # dmenu script to open up my games
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
get_category () { get_category() {
category=$( game-run list | $DMENU -p "Choose game category:") category=$(game-run list | $DMENU -p "Choose game category:")
[ -z "$category" ] && exit 0 [ -z "$category" ] && exit 0
} }
menu () { menu() {
while [ -z "$game" ] while [ -z "$game" ]; do
do
[ -z "$1" ] && game=$(game-run list "$category" | sed '/-18+/d' | $DMENU -p "Choose game to run:") [ -z "$1" ] && game=$(game-run list "$category" | sed '/-18+/d' | $DMENU -p "Choose game to run:")
[ "$1" = "-a" ] && game=$(game-run list "$category" | $DMENU -p "Choose game to run:") [ "$1" = "-a" ] && game=$(game-run list "$category" | $DMENU -p "Choose game to run:")
@ -22,7 +21,7 @@ menu () {
done done
} }
launch_game () { launch_game() {
if game-run launch "$game"; then if game-run launch "$game"; then
quick-notify "Game run" "Launching $game" quick-notify "Game run" "Launching $game"
else else
@ -30,12 +29,12 @@ launch_game () {
fi fi
} }
main () { main() {
load_config load_config
get_category get_category
menu menu $@
launch_game launch_game
} }

View File

@ -9,7 +9,7 @@ db=$(grep database ~/.config/dmenu-keepassxc/config | cut -d: -f 2)
kf=$(grep keyfile ~/.config/dmenu-keepassxc/config | cut -d: -f 2) kf=$(grep keyfile ~/.config/dmenu-keepassxc/config | cut -d: -f 2)
if [ "$2" = copy ]; then if [ "$2" = copy ]; then
$DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1" | xclip -sel c $DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1" | xclip -sel c && quick-notify "Dmenu-KeePassXC" "Password Copied"
else else
$DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1" $DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1"
fi fi

View File

@ -2,11 +2,11 @@
# kill those pesky proceses # kill those pesky proceses
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
main () { main() {
load_config load_config
pid=$(ps -e -o pid,%mem,%cpu,comm,cmd | sort -b -k3 -r | $DMENU -l 15 -i -p "Choose procces to kill: " | awk '{print $1}') pid=$(ps -e -o pid,%mem,%cpu,comm,cmd | sort -b -k3 -r | $DMENU -l 15 -i -p "Choose procces to kill: " | awk '{print $1}')

View File

@ -3,11 +3,11 @@
# Feed this script a link or it will get it from your clipboard and it will give dmenu # 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. # with some choice of programs to open the link with.
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
menu () { menu() {
case "$(printf "mpv\\nmpv audio\\nbrowser\\ncopy url [X11]\\ncopy url [Wayland]\\nw3m" | $DMENU -p "Open link with what program?")" in case "$(printf "mpv\\nmpv audio\\nbrowser\\ncopy url [X11]\\ncopy url [Wayland]\\nw3m" | $DMENU -p "Open link with what program?")" in
mpv) start-program "$VIDEO" "$@" ;; mpv) start-program "$VIDEO" "$@" ;;
"mpv audio") "$VIDEO" "$@" --no-video ;; "mpv audio") "$VIDEO" "$@" --no-video ;;
@ -18,7 +18,7 @@ menu () {
esac esac
} }
main () { main() {
load_config load_config
[ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@" [ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@"

View File

@ -3,17 +3,17 @@
# script to run a menu prompt when having more than 2 players since # script to run a menu prompt when having more than 2 players since
# playerctl is bad at managing more than one player at the same time # playerctl is bad at managing more than one player at the same time
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
menu () { menu() {
choice=$(playerctl -l | $DMENU -p 'Manage:') choice=$(playerctl -l | $DMENU -p 'Manage:')
[ -z "$choice" ] && exit [ -z "$choice" ] && exit
playerctl -p $choice $1 playerctl -p $choice $1
} }
main () { main() {
load_config load_config
command="$@" command="$@"

View File

@ -2,18 +2,18 @@
# simple power menu script # simple power menu script
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
menu () { menu() {
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
"shutdown") loginctl poweroff ;; "shutdown") loginctl poweroff ;;
"reboot") loginctl reboot ;; "reboot") loginctl reboot ;;
esac esac
} }
main () { main() {
load_config load_config
menu menu

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
convert_sizes () { convert_sizes() {
printf '%s\n' "$@" | \ printf '%s\n' "$@" |
while read size; do while read size; do
numfmt --to iec --format "%.2f" $size numfmt --to iec --format "%.2f" $size
done done
@ -9,7 +9,7 @@ convert_sizes () {
list() { list() {
num=1 num=1
printf '%s\n' "$1" | \ printf '%s\n' "$1" |
while read line in; do while read line in; do
category=$(printf '%s' "$2" | sed -n "${num}p") category=$(printf '%s' "$2" | sed -n "${num}p")
seeder=$(printf '%s' "$3" | sed -n "${num}p") seeder=$(printf '%s' "$3" | sed -n "${num}p")
@ -41,17 +41,17 @@ else
fi fi
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
All) url="$url";; All) url="$url" ;;
Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54";; Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54" ;;
"TV Shows") url="${url}&category=2;18;41;49";; "TV Shows") url="${url}&category=2;18;41;49" ;;
Games) url="${url}&category=2;27;28;29;30;31;53";; Games) url="${url}&category=2;27;28;29;30;31;53" ;;
Music) url="${url}&category=2;23;24;25;26";; Music) url="${url}&category=2;23;24;25;26" ;;
esac esac
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}" ) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}")
while [ "$response" = "" ]; do while [ "$response" = "" ]; do
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}" ) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}")
notify-send "RARGB" "Waiting 5 second for api limit to reset" notify-send "RARGB" "Waiting 5 second for api limit to reset"
sleep 5 sleep 5
done done

View File

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
main () { main() {
load_config load_config
choice=$(dmenu_path | grep dmenu- | $DMENU -p "Choose script to run:") choice=$(dmenu_path | grep dmenu- | $DMENU -p "Choose script to run:")

View File

@ -1,30 +1,29 @@
#!/bin/sh #!/bin/sh
# dmenu script for quickly setting ryzenadj profiles with my other script easily # dmenu script for quickly setting ryzenadj profiles with my other script easily
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
get_category () { get_category() {
category=$( sudo ryzenset list | $DMENU -i -p "Choose profile category:") category=$(sudo ryzenset list | $DMENU -i -p "Choose profile category:")
[ -z "$category" ] && exit 0 [ -z "$category" ] && exit 0
} }
get_current_profile () { get_current_profile() {
current_mode=$(sudo ryzenset get) current_mode=$(sudo ryzenset get)
} }
menu () { menu() {
while [ -z "$profile" ] while [ -z "$profile" ]; do
do
profile=$(sudo ryzenset list $category | $DMENU -i -p "Current: $current_mode:") profile=$(sudo ryzenset list $category | $DMENU -i -p "Current: $current_mode:")
[ -z "$profile" ] && get_category [ -z "$profile" ] && get_category
done done
} }
launch_profile () { launch_profile() {
if sudo ryzenset set "$profile"; then if sudo ryzenset set "$profile"; then
quick-notify "Ryzenset" "Setting $profile" quick-notify "Ryzenset" "Setting $profile"
else else
@ -32,7 +31,7 @@ launch_profile () {
fi fi
} }
main () { main() {
load_config load_config
get_category get_category

View File

@ -2,18 +2,24 @@
# It lets you choose the kind of screenshot to take, including # It lets you choose the kind of screenshot to take, including
# copying the image or even highlighting an area to copy. # copying the image or even highlighting an area to copy.
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
menu () { menu() {
case "$(printf "a selected area\\nfull screen" | $DMENU -l 6 -p "Screenshot which area?")" in case "$(printf "a selected area\\nfull screen" | $DMENU -l 6 -p "Screenshot which area?")" in
"a selected area") sleep 0.5; maim -m 2 -s $dir/pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;; "a selected area")
"full screen") sleep 0.5; maim -m 2 $dir/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;; sleep 0.5
maim -m 2 -s $dir/pic-selected-"$(date '+%y%m%d-%H%M-%S').png"
;;
"full screen")
sleep 0.5
maim -m 2 $dir/pic-full-"$(date '+%y%m%d-%H%M-%S').png"
;;
esac esac
} }
main () { main() {
dir="$HOME/pics/screenshots" dir="$HOME/pics/screenshots"
[ ! -d "$dir" ] && mkdir $dir -p [ ! -d "$dir" ] && mkdir $dir -p

View File

@ -1,10 +1,10 @@
#!/bin/env bash #!/bin/env bash
load_config () { load_config() {
source $HOME/.config/dmenu/config source $HOME/.config/dmenu/config
} }
move () { move() {
declare -a paths=( declare -a paths=(
"$HOME/vids/anime" "$HOME/vids/anime"
"$HOME/vids/movies" "$HOME/vids/movies"
@ -16,41 +16,46 @@ move () {
current=$(transmission-remote -t $1 -i | grep -i location | awk '{print $2}') current=$(transmission-remote -t $1 -i | grep -i location | awk '{print $2}')
choice=$(printf '%s\n' "${paths[@]}" | $DMENU -p "Current: $current") choice=$(printf '%s\n' "${paths[@]}" | $DMENU -i -p "Current: $current")
[ -z "$choice" ] && quick-notify "Transmission" "No path chosen" && exit [ -z "$choice" ] && quick-notify "Transmission" "No path chosen" && exit
[ ! -d "$choice" ] && mkdir -p "$choice" [ ! -d "$choice" ] && mkdir -p "$choice"
if transmission-remote -t $1 --move $choice ; then if transmission-remote -t $1 --move $choice; then
quick-notify "Transmission" "Moved $1 to $choice" quick-notify "Transmission" "Moved $1 to $choice"
else else
quick-notify "Transmission" "Couldn't move $1 to $choice" quick-notify "Transmission" "Couldn't move $1 to $choice"
fi fi
} }
menu () { menu() {
case "$(printf "Start\\nStop\\nMove\\nRemove" | $DMENU -p "Torrent Action: ")" in case "$(printf "Start\\nStop\\nMove\\nRemove" | $DMENU -i -p "Torrent Action: ")" in
Remove) transmission-remote -t $id -rad Remove)
transmission-remote -t $id -rad
quick-notify "Transmission" "Removed $id" quick-notify "Transmission" "Removed $id"
;; ;;
Start) transmission-remote -t $id -s Start)
transmission-remote -t $id -s
quick-notify "Transmission" "Started $id" quick-notify "Transmission" "Started $id"
;; ;;
Stop) transmission-remote -t $id -S Stop)
transmission-remote -t $id -S
quick-notify "Transmission" "Stoped $id" quick-notify "Transmission" "Stoped $id"
;; ;;
Move) move $id Move)
move $id
;; ;;
*) quick-notify "Transmission" "No action chosen" *)
quick-notify "Transmission" "No action chosen"
;; ;;
esac esac
} }
main () { main() {
load_config load_config
id=$(transmission-remote -l | $DMENU -l 10 | awk '{print $1}'| sed 's/*//') id=$(transmission-remote -l | $DMENU -i -l 10 | awk '{print $1}' | sed 's/*//')
[ -z "$id" ] && exit 0 [ -z "$id" ] && exit 0

View File

@ -2,15 +2,15 @@
# a simple dmenu usb managment script # a simple dmenu usb managment script
load_config () { load_config() {
. $HOME/.config/dmenu/config . $HOME/.config/dmenu/config
} }
driveCount(){ driveCount() {
count="$(printf '%s\n' "$1" | wc -l)" count="$(printf '%s\n' "$1" | wc -l)"
} }
mount(){ mount() {
mountable="$(lsblk -lp | awk '/^\/dev\/sd.*part $/ { print $1 " ("$4")" }')" mountable="$(lsblk -lp | awk '/^\/dev\/sd.*part $/ { print $1 " ("$4")" }')"
if [ "$mountable" = "" ]; then if [ "$mountable" = "" ]; then
@ -20,7 +20,7 @@ mount(){
chosen="$(printf '%s' "$mountable" | $DMENU -p "Drive to mount?")" chosen="$(printf '%s' "$mountable" | $DMENU -p "Drive to mount?")"
if [ -n "$chosen" ];then if [ -n "$chosen" ]; then
udisksctl mount -b "${chosen%% *}" udisksctl mount -b "${chosen%% *}"
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} mounted" quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} mounted"
else else
@ -30,7 +30,7 @@ mount(){
} }
unmount(){ unmount() {
mounted="$(lsblk -lp | awk '/run/ { print $1 " ("$4")" }')" mounted="$(lsblk -lp | awk '/run/ { print $1 " ("$4")" }')"
if [ "$mounted" = "" ]; then if [ "$mounted" = "" ]; then
@ -40,7 +40,7 @@ unmount(){
chosen="$(printf "$mounted" | $DMENU -p "Drive to unmount?")" chosen="$(printf "$mounted" | $DMENU -p "Drive to unmount?")"
if [ -n "$chosen" ];then if [ -n "$chosen" ]; then
udisksctl unmount -b "${chosen%% *}" udisksctl unmount -b "${chosen%% *}"
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} unmounted" quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} unmounted"
else else
@ -49,14 +49,14 @@ unmount(){
fi fi
} }
menu () { menu() {
case $(printf "mount\\nunmount" | $DMENU -p "Chose your usb action") in case $(printf "mount\\nunmount" | $DMENU -p "Chose your usb action") in
"mount") mount ;; "mount") mount ;;
"unmount") unmount ;; "unmount") unmount ;;
esac esac
} }
main () { main() {
load_config load_config
menu menu

View File

@ -14,7 +14,7 @@ elif [[ "$connected" =~ "disabled" ]]; then
fi fi
# Use dmenu to select wifi network # Use dmenu to select wifi network
chosen_network=$(printf '%s\n%s' "$toggle" "$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 # Get name of connection
chosen_id=$(printf '%s\n' "${chosen_network:3}" | xargs) chosen_id=$(printf '%s\n' "${chosen_network:3}" | xargs)
@ -33,7 +33,7 @@ else
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 -p "Password: " ) wifi_password=$($DMENU -P -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