Update formatting.
This commit is contained in:
parent
41754e8ad1
commit
e1c508c53b
@ -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" = "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
|
||||
|
@ -26,11 +26,11 @@ declare -a configs=(
|
||||
"xinitrc - $HOME/.config/X11/xinitrc"
|
||||
)
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
source $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
choice=$(printf '%s\n' "${configs[@]}" | $DMENU -l 10 -p 'Edit config:')
|
||||
|
17
dmenu-games
17
dmenu-games
@ -1,19 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
# dmenu script to open up my games
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
get_category () {
|
||||
category=$( game-run list | $DMENU -p "Choose game category:")
|
||||
get_category() {
|
||||
category=$(game-run list | $DMENU -p "Choose game category:")
|
||||
|
||||
[ -z "$category" ] && exit 0
|
||||
}
|
||||
|
||||
menu () {
|
||||
while [ -z "$game" ]
|
||||
do
|
||||
menu() {
|
||||
while [ -z "$game" ]; do
|
||||
[ -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:")
|
||||
@ -22,7 +21,7 @@ menu () {
|
||||
done
|
||||
}
|
||||
|
||||
launch_game () {
|
||||
launch_game() {
|
||||
if game-run launch "$game"; then
|
||||
quick-notify "Game run" "Launching $game"
|
||||
else
|
||||
@ -30,12 +29,12 @@ launch_game () {
|
||||
fi
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
get_category
|
||||
|
||||
menu
|
||||
menu $@
|
||||
|
||||
launch_game
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
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
|
||||
$DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1"
|
||||
fi
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
# kill those pesky proceses
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
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}')
|
||||
|
@ -3,11 +3,11 @@
|
||||
# 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.
|
||||
|
||||
load_config () {
|
||||
load_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
|
||||
mpv) start-program "$VIDEO" "$@" ;;
|
||||
"mpv audio") "$VIDEO" "$@" --no-video ;;
|
||||
@ -18,7 +18,7 @@ menu () {
|
||||
esac
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
[ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@"
|
||||
|
@ -3,17 +3,17 @@
|
||||
# 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
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
menu () {
|
||||
menu() {
|
||||
choice=$(playerctl -l | $DMENU -p 'Manage:')
|
||||
[ -z "$choice" ] && exit
|
||||
playerctl -p $choice $1
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
command="$@"
|
||||
|
@ -2,18 +2,18 @@
|
||||
|
||||
# simple power menu script
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
menu () {
|
||||
menu() {
|
||||
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
|
||||
"shutdown") loginctl poweroff ;;
|
||||
"reboot") loginctl reboot ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
menu
|
||||
|
20
dmenu-rarbg
20
dmenu-rarbg
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
convert_sizes () {
|
||||
printf '%s\n' "$@" | \
|
||||
convert_sizes() {
|
||||
printf '%s\n' "$@" |
|
||||
while read size; do
|
||||
numfmt --to iec --format "%.2f" $size
|
||||
done
|
||||
@ -9,7 +9,7 @@ convert_sizes () {
|
||||
|
||||
list() {
|
||||
num=1
|
||||
printf '%s\n' "$1" | \
|
||||
printf '%s\n' "$1" |
|
||||
while read line in; do
|
||||
category=$(printf '%s' "$2" | sed -n "${num}p")
|
||||
seeder=$(printf '%s' "$3" | sed -n "${num}p")
|
||||
@ -41,17 +41,17 @@ else
|
||||
fi
|
||||
|
||||
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
|
||||
All) url="$url";;
|
||||
Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54";;
|
||||
"TV Shows") url="${url}&category=2;18;41;49";;
|
||||
Games) url="${url}&category=2;27;28;29;30;31;53";;
|
||||
Music) url="${url}&category=2;23;24;25;26";;
|
||||
All) url="$url" ;;
|
||||
Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54" ;;
|
||||
"TV Shows") url="${url}&category=2;18;41;49" ;;
|
||||
Games) url="${url}&category=2;27;28;29;30;31;53" ;;
|
||||
Music) url="${url}&category=2;23;24;25;26" ;;
|
||||
esac
|
||||
|
||||
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}" )
|
||||
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}")
|
||||
|
||||
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"
|
||||
sleep 5
|
||||
done
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
choice=$(dmenu_path | grep dmenu- | $DMENU -p "Choose script to run:")
|
||||
|
@ -1,30 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# dmenu script for quickly setting ryzenadj profiles with my other script easily
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
get_category () {
|
||||
category=$( sudo ryzenset list | $DMENU -i -p "Choose profile category:")
|
||||
get_category() {
|
||||
category=$(sudo ryzenset list | $DMENU -i -p "Choose profile category:")
|
||||
|
||||
[ -z "$category" ] && exit 0
|
||||
}
|
||||
|
||||
get_current_profile () {
|
||||
get_current_profile() {
|
||||
current_mode=$(sudo ryzenset get)
|
||||
}
|
||||
|
||||
menu () {
|
||||
while [ -z "$profile" ]
|
||||
do
|
||||
menu() {
|
||||
while [ -z "$profile" ]; do
|
||||
profile=$(sudo ryzenset list $category | $DMENU -i -p "Current: $current_mode:")
|
||||
|
||||
[ -z "$profile" ] && get_category
|
||||
done
|
||||
}
|
||||
|
||||
launch_profile () {
|
||||
launch_profile() {
|
||||
if sudo ryzenset set "$profile"; then
|
||||
quick-notify "Ryzenset" "Setting $profile"
|
||||
else
|
||||
@ -32,7 +31,7 @@ launch_profile () {
|
||||
fi
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
get_category
|
||||
|
@ -2,18 +2,24 @@
|
||||
|
||||
# It lets you choose the kind of screenshot to take, including
|
||||
# copying the image or even highlighting an area to copy.
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
menu () {
|
||||
menu() {
|
||||
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" ;;
|
||||
"full screen") sleep 0.5; maim -m 2 $dir/pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
||||
"a selected area")
|
||||
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
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
dir="$HOME/pics/screenshots"
|
||||
[ ! -d "$dir" ] && mkdir $dir -p
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/env bash
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
source $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
move () {
|
||||
move() {
|
||||
declare -a paths=(
|
||||
"$HOME/vids/anime"
|
||||
"$HOME/vids/movies"
|
||||
@ -16,41 +16,46 @@ move () {
|
||||
|
||||
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
|
||||
|
||||
[ ! -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"
|
||||
else
|
||||
quick-notify "Transmission" "Couldn't move $1 to $choice"
|
||||
fi
|
||||
}
|
||||
|
||||
menu () {
|
||||
case "$(printf "Start\\nStop\\nMove\\nRemove" | $DMENU -p "Torrent Action: ")" in
|
||||
Remove) transmission-remote -t $id -rad
|
||||
menu() {
|
||||
case "$(printf "Start\\nStop\\nMove\\nRemove" | $DMENU -i -p "Torrent Action: ")" in
|
||||
Remove)
|
||||
transmission-remote -t $id -rad
|
||||
quick-notify "Transmission" "Removed $id"
|
||||
;;
|
||||
Start) transmission-remote -t $id -s
|
||||
Start)
|
||||
transmission-remote -t $id -s
|
||||
quick-notify "Transmission" "Started $id"
|
||||
;;
|
||||
Stop) transmission-remote -t $id -S
|
||||
Stop)
|
||||
transmission-remote -t $id -S
|
||||
quick-notify "Transmission" "Stoped $id"
|
||||
;;
|
||||
Move) move $id
|
||||
Move)
|
||||
move $id
|
||||
;;
|
||||
*) quick-notify "Transmission" "No action chosen"
|
||||
*)
|
||||
quick-notify "Transmission" "No action chosen"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
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
|
||||
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
# a simple dmenu usb managment script
|
||||
|
||||
load_config () {
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
driveCount(){
|
||||
driveCount() {
|
||||
count="$(printf '%s\n' "$1" | wc -l)"
|
||||
}
|
||||
|
||||
mount(){
|
||||
mount() {
|
||||
mountable="$(lsblk -lp | awk '/^\/dev\/sd.*part $/ { print $1 " ("$4")" }')"
|
||||
|
||||
if [ "$mountable" = "" ]; then
|
||||
@ -20,7 +20,7 @@ mount(){
|
||||
|
||||
chosen="$(printf '%s' "$mountable" | $DMENU -p "Drive to mount?")"
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
if [ -n "$chosen" ]; then
|
||||
udisksctl mount -b "${chosen%% *}"
|
||||
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} mounted"
|
||||
else
|
||||
@ -30,7 +30,7 @@ mount(){
|
||||
|
||||
}
|
||||
|
||||
unmount(){
|
||||
unmount() {
|
||||
mounted="$(lsblk -lp | awk '/run/ { print $1 " ("$4")" }')"
|
||||
|
||||
if [ "$mounted" = "" ]; then
|
||||
@ -40,7 +40,7 @@ unmount(){
|
||||
|
||||
chosen="$(printf "$mounted" | $DMENU -p "Drive to unmount?")"
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
if [ -n "$chosen" ]; then
|
||||
udisksctl unmount -b "${chosen%% *}"
|
||||
quick-notify "Dmenu Usb Manager" "Drive ${chosen%% *} unmounted"
|
||||
else
|
||||
@ -49,14 +49,14 @@ unmount(){
|
||||
fi
|
||||
}
|
||||
|
||||
menu () {
|
||||
menu() {
|
||||
case $(printf "mount\\nunmount" | $DMENU -p "Chose your usb action") in
|
||||
"mount") mount ;;
|
||||
"unmount") unmount ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main () {
|
||||
main() {
|
||||
load_config
|
||||
|
||||
menu
|
||||
|
@ -14,7 +14,7 @@ elif [[ "$connected" =~ "disabled" ]]; then
|
||||
fi
|
||||
|
||||
# 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
|
||||
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"
|
||||
else
|
||||
if [[ "$chosen_network" =~ "" ]]; then
|
||||
wifi_password=$($DMENU -P -p "Password: " )
|
||||
wifi_password=$($DMENU -P -p "Password: ")
|
||||
fi
|
||||
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && quick-notify "Connection Established" "$success_message"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user