fixed dmenu scripts

This commit is contained in:
Clay Gomera 2023-06-24 13:00:22 -04:00
parent 5614e7337d
commit 141eb12db1
6 changed files with 107 additions and 86 deletions

View file

@ -5,18 +5,17 @@
# - Dependencies: dmenu (Everything else can be changed) # - Dependencies: dmenu (Everything else can be changed)
# Show list of options # Show list of options
EDITOR="emacsclient -c -a emacs"
cd "$HOME" || exit 0 cd "$HOME" || exit 0
file=1 file=1
while [ "$file" ]; do while [ "$file" ]; do
file=$(fd -LHpd 1 | dmenu -i -l 10 -p "file to edit: $(basename "$(pwd)")") file=$(fd -LHpd 1 | dmenu -i -l 10 -p "󰈙 Open file in text editor $(basename "$(pwd)")")
if [ -e "$file" ]; then if [ -e "$file" ]; then
owd=$(pwd) owd=$(pwd)
if [ -d "$file" ]; then if [ -d "$file" ]; then
cd "$file" || exit 0 cd "$file" || exit 0
else [ -f "$file" ] else [ -f "$file" ]
if [ "$file" ]; then if [ "$file" ]; then
$EDITOR "$owd/$file" & $VISUAL "$owd/$file" &
exit 0 exit 0
else else
exit 0 exit 0

View file

@ -5,28 +5,24 @@
# - Dependencies: dmenu, power-profiles-daemon # - Dependencies: dmenu, power-profiles-daemon
## OPTIONS ## ## OPTIONS ##
option1="logout" option1=" Logout"
option2="reboot" option2=" Reboot"
option3="power off" option3=" Power off"
option4="suspend" option4="󰒲 Suspend"
option5="lock" option5=" Lock"
option6="change power profile" option6=" Change power profile"
option7="cancel" option7=" Cancel"
## OPTIONS ARRAY ##
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7"
## POWER PROFILE OPTIONS ## ## POWER PROFILE OPTIONS ##
pwr1="performance" pwr1="󰓅 Performance"
pwr2="balanced" pwr2="󰾅 Balanced"
pwr3="powersaver" pwr3="󰾆 Power Saver"
pwr4="cancel" pwr4=" Cancel"
## POWER PROFILES ARRAY ##
pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4" pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4"
## MAIN ACTION COMMAND ## ## MAIN ACTION COMMAND ##
action=$(echo -e "$options" | dmenu -i -p "power options:") action=$(echo -e "$options" | dmenu -i -p " Power Options")
case "$action" in case "$action" in
$option1*) $option1*)
pkill X;; pkill X;;
@ -40,14 +36,21 @@ case "$action" in
slock;; slock;;
$option6*) $option6*)
currentpwr=$(powerprofilesctl get) currentpwr=$(powerprofilesctl get)
pwraction=$(echo -e "$pwrs" | dmenu -i -p "current profile is: ${currentpwr} | select profile:") if [ "$currentpwr" = "performance" ]; then
currentpwr="$pwr1"
elif [ "$currentpwr" = "balanced" ]; then
currentpwr="$pwr2"
elif [ "$currentpwr" = "power-saver" ]; then
currentpwr="$pwr3"
fi
pwraction=$(echo -e "$pwrs" | dmenu -i -p " Power Profile Menu - Currently set to: ${currentpwr}")
case "$pwraction" in case "$pwraction" in
$pwr1*) $pwr1*)
powerprofilesctl set performance && notify-send "power profile switched to performance";; powerprofilesctl set performance && notify-send "Power profile switched to performance";;
$pwr2*) $pwr2*)
powerprofilesctl set balanced && notify-send "power profile switched to balanced";; powerprofilesctl set balanced && notify-send "Power profile switched to balanced";;
$pwr3*) $pwr3*)
powerprofilesctl set power-saver && notify-send "power profile switched to power saver";; powerprofilesctl set power-saver && notify-send "Power profile switched to power saver";;
$pwr4*) $pwr4*)
exit 0 exit 0
esac;; esac;;

View file

@ -2,42 +2,42 @@
# ***This script was made by Clay Gomera (Drake)*** # ***This script was made by Clay Gomera (Drake)***
# - Description: A simple screenshot dmenu script # - Description: A simple screenshot dmenu script
# - Dependencies: scrot, dmenu, notify-send # - Dependencies: escrotum, dmenu, notify-send
## CREATING SCREENSHOT FOLDER ## ## CREATING SCREENSHOT FOLDER ##
mkdir -p "$HOME/Pictures/Screenshots" mkdir -p "$HOME/Media/Pictures/Screenshots"
cd "$HOME/Pictures/Screenshots" || exit 0 cd "$HOME/Media/Pictures/Screenshots" || exit 0
## CHOICES ## ## CHOICES ##
cho1="entire screen" cho1="󱣴 Entire screen"
cho2="entire screen with delay" cho2="󱎫 Entire screen with delay"
cho3="focused window" cho3="󱕻 Select window or area"
cho4="select area" cho4="󱎘 Exit"
chos="$cho1\n$cho2\n$cho3\n$cho4" chos="$cho1\n$cho2\n$cho3\n$cho4"
## DELAY OPTIONS ## ## DELAY OPTIONS ##
del1="3 sec delay" del1="󱑀 3 sec delay"
del2="5 sec delay" del2="󱑂 5 sec delay"
del3="10 sec delay" del3="󱑇 10 sec delay"
dels="$del1\n$del2\n$del3" dels="$del1\n$del2\n$del3"
## MAIN ACTION ## ## MAIN ACTION ##
choice=$(echo -e "$chos" | dmenu -i -p "Select: ") choice=$(echo -e "$chos" | dmenu -i -p " Sreenshot Menu")
case $choice in case $choice in
$cho1) "$cho1")
scrot && notify-send "screenshot saved";; escrotum && notify-send "Screenshot saved";;
$cho2) "$cho2")
del=$(echo -e "$dels" | dmenu -i -p "Select: "); del=$(echo -e "$dels" | dmenu -i -p "Select Delay");
case $del in case $del in
$del1) "$del1")
scrot -d 3 && notify-send "screenshot saved";; escrotum -d 3 -C && notify-send "Screenshot saved";;
$del2) "$del2")
scrot -d 5 && notify-send "screenshot saved";; escrotum -d 5 -C && notify-send "Screenshot saved";;
$del3) "$del3")
scrot -d 10 && notify-send "screenshot saved" escrotum -d 10 -C && notify-send "Screenshot saved"
esac;; esac ;;
$cho3) "$cho3")
scrot -u -b && notify-send "screenshot saved.";; escrotum -s && notify-send "Screenshot saved.";;
$cho4) "$cho4")
scrot -s && notify-send "screenshot saved." exit 0
esac esac

View file

@ -2,43 +2,43 @@
# ***This script was made by Clay Gomera (Drake)*** # ***This script was made by Clay Gomera (Drake)***
# - Description: A simple wallpaper changer script # - Description: A simple wallpaper changer script
# - Dependencies: dmenu, fd, feh # - Dependencies: rofi, fd, feh
## MAIN VARIABLES AND COMMANDS ## ## MAIN VARIABLES AND COMMANDS ##
walldir="Pictures/Wallpapers" walldir="$HOME/Media/Pictures/Wallpapers"
cd "$walldir" || exit cd "$walldir" || exit
## SELECT PICTURE FUNCTION ## ## SELECT PICTURE FUNCTION ##
selectpic() { selectpic() {
wallpaper=$(fd -p "$walldir" | dmenu -i -l 10 -p "select a wallpaper:") wallpaper=$(fd -p "$walldir" | dmenu -i -p " 󰋩 Select a wallpaper ")
if [ "$wallpaper" ]; then if [ "$wallpaper" ]; then
chosenwall=$wallpaper chosenwall=$wallpaper
else else
exit 0 exit 0
fi fi
} }
selectpic selectpic
## WALLPAPER SETTING OPTIONS ## ## WALLPAPER SETTING OPTIONS ##
option1="fill" option1="Fill"
option2="center" option2="Center"
option3="tile" option3="Tile"
option4="max" option4="Max"
option5="scale" option5="Scale"
options="$option1\n$option2\n$option3\n$option4\n$option5" options="$option1\n$option2\n$option3\n$option4\n$option5"
## MAIN ACTION ## ## MAIN ACTION ##
action=$(echo -e "$options" | dmenu -i -l 5 -p "chose the format:") action=$(echo -e "$options" | dmenu -i -p "  Chose the format ")
case "$action" in case "$action" in
$option1*) $option1*)
feh --bg-fill "$chosenwall";; feh --bg-fill "$chosenwall";;
$option2*) $option2*)
feh --bg-center "$chosenwall";; feh --bg-center "$chosenwall";;
$option3*) $option3*)
feh --bg-tile "$chosenwall";; feh --bg-tile "$chosenwall";;
$option4*) $option4*)
feh --bg-max "$chosenwall";; feh --bg-max "$chosenwall";;
$option5*) $option5*)
feh --bg-scale "$chosenwall";; feh --bg-scale "$chosenwall";;
esac esac
exit 0 exit 0

View file

@ -5,12 +5,12 @@
# - Dependencies: dmenu, NetworkManager # - Dependencies: dmenu, NetworkManager
## MAIN OPTIONS ## ## MAIN OPTIONS ##
option1="turn on wifi" option1=" Turn on WiFi"
option2="turn off wifi" option2=" Turn off WiFi"
option3="disconnect wifi" option3="󱛅 Disconnect WiFi"
option4="connect wifi" option4="󱛃 Connect WiFi"
option5="setup captive portal" option5="󱛆 Setup captive portal"
option6="exit" option6=" Exit"
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1) wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)
@ -40,12 +40,12 @@ disconnect() {
connect() { connect() {
notify-send "Scannig networks, please wait" notify-send "Scannig networks, please wait"
sleep 1 sleep 1
bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -i -fn "mononoki Nerd Font-12" -l 10 -nb \#1d2021 -nf \#fbf1c7 -sb \#cc241d -sf \#fbf1c7 -p "select wifi:" | cut -d' ' -f1) bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -i -p "Select a Wifi Network  " | cut -d' ' -f1)
} }
## SELECT PASSWORD FUNCTION ## ## SELECT PASSWORD FUNCTION ##
password() { password() {
pass=$(echo " " | dmenu -P -i -p "enter password:") pass=$(echo " " | dmenu -P -i -p "Enter Password ")
} }
## MAIN CONNECTION COMMAND ## ## MAIN CONNECTION COMMAND ##
@ -66,7 +66,7 @@ check() {
} }
## MAIN ACTION COMMANDS ## ## MAIN ACTION COMMANDS ##
cases=$(echo -e "$options" | dmenu -i -p "wifi options:" ) cases=$(echo -e "$options" | dmenu -i -p " Wifi Settings" )
case "$cases" in case "$cases" in
$option1*) $option1*)
turnon;; turnon;;
@ -76,9 +76,13 @@ case "$cases" in
disconnect;; disconnect;;
$option4*) $option4*)
connect; connect;
password; if [ -n "$bssid" ]; then
action; password;
check;; action;
check;
else
exit 0;
fi;;
$option5*) $option5*)
$BROWSER http://networkcheck.kde.org;; $BROWSER http://networkcheck.kde.org;;
$option6*) $option6*)

View file

@ -0,0 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Temporal/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Temporal/Downloads"
XDG_TEMPLATES_DIR="$HOME/Temporal/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Temporal/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Media/Music"
XDG_PICTURES_DIR="$HOME/Media/Pictures"
XDG_VIDEOS_DIR="$HOME/Media/Videos"