workspace/arch-user/scripts/run.sh
2024-12-15 23:37:24 +00:00

66 lines
968 B
Bash
Executable File

#!/bin/sh
if [ "$USER" = "yrzam" ]; then
WEB="\
web projects
web life\
"
else
WEB=web
fi
LIST="\
term
$WEB
vifm
vim
gimp
htop
man
sway reload
logout
poweroff
reboot\
"
out=$(bemenu --prompt "" << EOF
$LIST
EOF
)
conf() {
echo yes | bemenu --prompt "sure?"
}
case "$out " in
" ");;
"web "*)
profile="${out##* }"
if [ "$profile" != "web" ]; then
exec firefox -P "$profile"
else
exec firefox
fi;;
"man ")
page="$(man -k . | bemenu --prompt "man" | awk '{print $1}')"
[ -n "$page" ] && exec footclient man "$page";;
"logout ")
conf && swaymsg exit;;
"poweroff "|"reboot ")
conf && exec systemctl "$out";;
"sway reload ")
exec $out;;
# term session
"term ")
exec footclient -D ~/;;
# term exec pure
"man "*|"htop ")
exec footclient -D ~/ "$out";;
# term exec in shell
"vifm "*|"vim "*)
exec footclient -D ~/ "$SHELL" -c "$out";;
#term exec in shell and wait
*)
exec footclient -D ~/ "$SHELL" -c "$out; read -n1";;
esac