Using a config made dmenu.
This commit is contained in:
parent
587f300ac7
commit
321f370263
@ -2,6 +2,8 @@
|
||||
|
||||
# a script to quickly open up one of my many configs
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
editor="$TERMINAL -e $EDITOR"
|
||||
|
||||
declare -a configs=(
|
||||
@ -28,7 +30,7 @@ declare -a configs=(
|
||||
"qtile - $HOME/.config/qtile/config.py"
|
||||
)
|
||||
|
||||
choice=$(printf '%s\n' "${configs[@]}" | dmenu -l 10 -p 'Edit config:')
|
||||
choice=$(printf '%s\n' "${configs[@]}" | $DMENU -l 10 -p 'Edit config:')
|
||||
|
||||
[ -z "$choice" ] && exit
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
word="$(printf '\n' | dmenu -p "Enter Word")"
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
dym -c $word | dmenu -p "Select spelling" | xclip -selection clipboard
|
||||
word="$(printf '\n' | $DMENU -p "Enter Word")"
|
||||
|
||||
dym -c $word | $DMENU -p "Select spelling" | xclip -selection clipboard
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
# script to download a file from that has it's link in clipboard
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
# 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")
|
||||
(ls -1 -a | $DMENU -l 30 -p "Choose where to download")
|
||||
}
|
||||
|
||||
# first choice
|
||||
|
@ -4,13 +4,14 @@
|
||||
# and it will list all your files and open them
|
||||
# in your prefered program with xdg-open
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
# 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
|
||||
|
@ -2,8 +2,10 @@
|
||||
|
||||
# dmenu script to open up my games
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
get_category () {
|
||||
category=$( game-run list | dmenu -p "Choose game category:")
|
||||
category=$( game-run list | $DMENU -p "Choose game category:")
|
||||
|
||||
[ -z "$category" ] && exit 0
|
||||
}
|
||||
@ -14,9 +16,9 @@ while [ -z "$game" ]
|
||||
do
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
game=$(game-run list $category | sed '/-18+/d' | dmenu -p "Choose game to run:")
|
||||
game=$(game-run list $category | sed '/-18+/d' | $DMENU -p "Choose game to run:")
|
||||
elif [ "$1" = "-a" ]; then
|
||||
game=$(game-run list $category | dmenu -p "Choose game to run:")
|
||||
game=$(game-run list $category | $DMENU -p "Choose game to run:")
|
||||
else
|
||||
printf '%s\n' "Option $1 doesn't exit!!"
|
||||
exit 1
|
||||
|
@ -2,11 +2,13 @@
|
||||
|
||||
# kill those pesky proceses
|
||||
|
||||
selected=$(ps --user "$USER" -F | dmenu -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}')
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
selected=$(ps --user "$USER" -F | $DMENU -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}')
|
||||
|
||||
[ -n "$selected" ] || exit
|
||||
|
||||
answer=$(printf "yes\\nno" | dmenu -p "Are you sure?")
|
||||
answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?")
|
||||
|
||||
[ $answer = "yes" ] || exit
|
||||
|
||||
|
@ -3,4 +3,6 @@
|
||||
# This script is the SUDO_ASKPASS variable, meaning that it will be used as a
|
||||
# password prompt if needed.
|
||||
|
||||
dmenu -P -p "$1" <&- && echo
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
$DMENU -P -p "$1" <&- && echo
|
||||
|
@ -3,6 +3,8 @@
|
||||
# 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
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
command="$@"
|
||||
instances=$(playerctl -l | wc -l)
|
||||
|
||||
@ -11,6 +13,6 @@ if [ "$instances" = "0" ]; then
|
||||
elif [ "$instances" -lt "2" ]; then
|
||||
playerctl $command
|
||||
else
|
||||
choice=$(playerctl -l | dmenu -p 'Manage:')
|
||||
choice=$(playerctl -l | $DMENU -p 'Manage:')
|
||||
playerctl -p $choice $command
|
||||
fi
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
# simple power menu script
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | dmenu -p "Choose your poison")" in
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
case "$(printf "shutdown\\nreboot" | $DMENU -p "Choose your poison")" in
|
||||
"shutdown") sudo poweroff ;;
|
||||
"reboot") sudo reboot ;;
|
||||
esac
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
# dmenu script to run one of my most runned programs
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
declare -a software=(
|
||||
"bitwarden-desktop"
|
||||
"megasync"
|
||||
@ -9,7 +11,7 @@ declare -a software=(
|
||||
"discord"
|
||||
)
|
||||
|
||||
choice=$(printf "%s\n" "${software[@]}" | dmenu -p "Choose software to run")
|
||||
choice=$(printf "%s\n" "${software[@]}" | $DMENU -p "Choose software to run")
|
||||
|
||||
[ -n $choice ] || exit
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
notAvailable=$(pactl list sinks | grep 'analog-output-headphones' | grep 'not available')
|
||||
|
||||
[ ! -z "$notAvailable" ] && quick-notify "Port Master" "Only one port available" && exit
|
||||
@ -7,7 +9,7 @@ notAvailable=$(pactl list sinks | grep 'analog-output-headphones' | grep 'not av
|
||||
current=$(pactl list sinks | grep 'Active Port' | awk '{ print $3 }')
|
||||
[ "$current" = "analog-output-speaker" ] && current="Speakers" || current="Headphones"
|
||||
|
||||
case "$(printf "Speakers\\nHeadphones" | dmenu -p "Current: $current ")" in
|
||||
case "$(printf "Speakers\\nHeadphones" | $DMENU -p "Current: $current ")" in
|
||||
"Speakers") pactl set-sink-port 0 analog-output-speaker ;;
|
||||
"Headphones") pactl set-sink-port 0 analog-output-headphones ;;
|
||||
esac
|
||||
|
@ -3,8 +3,11 @@
|
||||
# script to run roms from different systems in their respective emulators
|
||||
|
||||
# a functions that list all everything in a directory and gives back the chosen one
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
choice (){
|
||||
(ls -1 | dmenu -l 30 -p "Choose your $system rom!")
|
||||
(ls -1 | $DMENU -l 30 -p "Choose your $system rom!")
|
||||
}
|
||||
|
||||
run_rom (){
|
||||
@ -41,7 +44,7 @@ declare -a systems=(
|
||||
)
|
||||
|
||||
|
||||
case "$(printf '%s\n' "${systems[@]}" | dmenu -l 10 -p "Chose retro console:")" in
|
||||
case "$(printf '%s\n' "${systems[@]}" | $DMENU -l 10 -p "Chose retro console:")" in
|
||||
"Nintendo - Nintendo Entertainment System (1983-2003)")
|
||||
emulator="fceux"
|
||||
system="NES"
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
choice=$(dmenu_path | grep dmenu- | dmenu -p "Choose script to run:")
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
choice=$(dmenu_path | grep dmenu- | $DMENU -p "Choose script to run:")
|
||||
|
||||
$choice
|
||||
|
@ -18,5 +18,5 @@ case "$(printf "normal mode\\nlight gaming\\nheavy gaming\\nheavy programs\\nhea
|
||||
"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 ;;
|
||||
"heavy gaming pro") sudo ryzenadj --slow-time=60 --vrmmax-current=70000 --tctl-temp=85 --stapm-limit=35000 --stapm-time=1000 --fast-limit=35000 --slow-limit=35000 --max-performance; break ;;
|
||||
esac
|
||||
|
@ -2,11 +2,12 @@
|
||||
|
||||
# A script to run my game specifiy ryzenadj scripts
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
# cd into the given directory
|
||||
cd $1
|
||||
|
||||
profile=$(ls -1 -A | dmenu -l 30 -p "Choose your file!")
|
||||
profile=$(ls -1 -A | $DMENU -l 5 -p "Choose your file!")
|
||||
|
||||
[ -n "$profile" ] || exit
|
||||
|
||||
|
@ -3,10 +3,12 @@
|
||||
# It lets you choose the kind of screenshot to take, including
|
||||
# copying the image or even highlighting an area to copy.
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
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
|
||||
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" ;;
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
# a simple dmenu usb managment script
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
driveCount(){
|
||||
count="$(printf '%s\n' "$1" | wc -l)"
|
||||
}
|
||||
@ -10,11 +12,11 @@ mount(){
|
||||
mountable="$(lsblk -lp | awk '/^\/dev\/sd.*part $/ { print $1 " ("$4")" }')"
|
||||
|
||||
if [ "$mountable" = "" ]; then
|
||||
quick-notify "Dmenu Usb Manager" "No drives to mount"
|
||||
quick-notify "$DMENU Usb Manager" "No drives to mount"
|
||||
exit
|
||||
fi
|
||||
|
||||
chosen="$(printf '%s' "$mountable" | dmenu -p "Drive to mount?")"
|
||||
chosen="$(printf '%s' "$mountable" | $DMENU -p "Drive to mount?")"
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
udisksctl mount -b "${chosen%% *}"
|
||||
@ -34,7 +36,7 @@ unmount(){
|
||||
exit
|
||||
fi
|
||||
|
||||
chosen="$(printf "$mounted" | dmenu -p "Drive to unmount?")"
|
||||
chosen="$(printf "$mounted" | $DMENU -p "Drive to unmount?")"
|
||||
|
||||
if [ -n "$chosen" ];then
|
||||
udisksctl unmount -b "${chosen%% *}"
|
||||
@ -45,7 +47,7 @@ unmount(){
|
||||
fi
|
||||
}
|
||||
|
||||
case $(printf "mount\\nunmount" | dmenu -p "Chose your usb action") in
|
||||
case $(printf "mount\\nunmount" | $DMENU -p "Chose your usb action") in
|
||||
"mount") mount ;;
|
||||
"unmount") unmount ;;
|
||||
esac
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
quick-notify "Getting list of available Wi-Fi networks..."
|
||||
# Get a list of available wifi connections and morph it into a nice-looking list
|
||||
wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list --rescan yes | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d")
|
||||
@ -12,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)
|
||||
|
||||
@ -31,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 "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
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
# Search offline copy of the arch wiki
|
||||
|
||||
source $HOME/.config/dmenu/config
|
||||
|
||||
dir="/usr/share/doc/arch-wiki/html/en/"
|
||||
|
||||
docs="$(find $dir -iname "*.html")"
|
||||
@ -11,7 +13,7 @@ main () {
|
||||
cut -d '/' -f8- | \
|
||||
sed -e 's/_/ /g' -e 's/.html//g' | \
|
||||
sort | \
|
||||
dmenu -i -l 20 -p "Arch Wiki Docs:")
|
||||
$DMENU -i -l 20 -p "Arch Wiki Docs:")
|
||||
|
||||
if [ "$choice" ]; then
|
||||
article=$(printf '%s\n' "${dir}${choice}.html" | sed 's/ /_/g')
|
||||
|
Loading…
Reference in New Issue
Block a user