mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-19 13:46:17 +10:00
Restructing the entire dotfile repo!
This commit is contained in:
12
.jwm/menus/recent-files.sh
Executable file
12
.jwm/menus/recent-files.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
XBEL_PATH=/home/dt/.local/share/recently-used.xbel
|
||||
MAX_ITEMS=20
|
||||
|
||||
if [[ -e $XBEL_PATH ]];then
|
||||
ITEMS=$(sed -rn 's_.*file://([^"]*).*_<Program label="\1">rox -s "\1"</Program>_ p' "$XBEL_PATH")
|
||||
else
|
||||
ITEMS="<Program label=\"File ${XBEL_PATH##*/} not found!\"></Program>"
|
||||
fi
|
||||
echo "<JWM>"
|
||||
echo -e "${ITEMS//%/\\x}" | tail -n $MAX_ITEMS
|
||||
echo "</JWM>"
|
||||
25
.jwm/menus/shutdown.sh
Executable file
25
.jwm/menus/shutdown.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
DIALOG=Xdialog
|
||||
|
||||
$DIALOG --allow-close\
|
||||
--stdout\
|
||||
--title 'Exit'\
|
||||
--menu 'Choose action..'\
|
||||
15 50 10 \
|
||||
'Shutdown' "" \
|
||||
'Reboot' "" \
|
||||
'Suspend to RAM' "" \
|
||||
'Suspend to Disk' "" \
|
||||
1> /tmp/exitval.$$ 2> /dev/null
|
||||
|
||||
ACTION=`cat /tmp/exitval.$$`
|
||||
rm -f /tmp/exitval.$$
|
||||
|
||||
case $ACTION in
|
||||
'Shutdown') sudo halt ;;
|
||||
'Reboot') sudo reboot ;;
|
||||
'Suspend to RAM') sudo s2ram ;;
|
||||
'Suspend to Disk') sudo s2disk ;;
|
||||
*) exit ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user