Skip to content
Permalink
Browse files

jwm_config: recently used menu (thanks to MochiMoppel)

  • Loading branch information...
zigbert committed Sep 24, 2016
1 parent 387eec4 commit fb628e65177e5d89767989ed3d49b53617124b3a
@@ -12,6 +12,7 @@ echo '
[ -d $HOME/Downloads ] && echo '<Program label="'$(gettext 'Downloads')'" icon="/usr/local/lib/X11/pixmaps/folder48.png">rox $HOME/Downloads</Program>'
echo '<Separator/>
<Dynamic label="'$(gettext 'Drives')'" icon="/usr/local/lib/X11/pixmaps/drive48.png">exec:/usr/local/jwm_config/menu_build_places_drives</Dynamic>
<Dynamic label="'$(gettext 'Recently used')'" icon="file.svg">exec:/usr/local/jwm_config/menu_build_recent_docs</Dynamic>
<Separator/>
<Program label="'$(gettext 'Web')'" icon="/usr/local/lib/X11/pixmaps/www48.png">defaultbrowser</Program>
<Program label="'$(gettext 'Help')'" icon="/usr/local/lib/X11/pixmaps/help48.png">exec defaultbrowser file:///usr/share/doc/index.html</Program>
@@ -0,0 +1,17 @@
#!/bin/bash
#this script is started from $HOME/.jwmrc

export TEXTDOMAIN=jwm
export OUTPUT_CHARSET=UTF-8

XBEL_PATH=/root/.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=\"${XBEL_PATH##*/} $(gettext 'not found')!\"></Program>"
fi
echo '<JWM>'
echo -e "${ITEMS//%/\\x}" | tail -n $MAX_ITEMS
echo '</JWM>'
@@ -151,6 +151,7 @@ func_apply_mouseactions () {
case $ROOT1 in
"$(gettext 'Bookmarks menu')") ln -sf /usr/local/jwm_config/menu_build_bookmarks $HOME/.jwm/root_menus/menu1;;
"$(gettext 'Main menu')") ln -sf /usr/local/jwm_config/menu_build_main $HOME/.jwm/root_menus/menu1;;
"$(gettext 'Recently used documents')") ln -sf /usr/local/jwm_config/menu_build_recent_docs $HOME/.jwm/root_menus/menu1;;
"$(gettext 'Clock menu')") ln -sf /usr/local/jwm_config/menu_build_clock $HOME/.jwm/root_menus/menu1;;
"$(gettext 'Places menu')") ln -sf /usr/local/jwm_config/menu_build_places $HOME/.jwm/root_menus/menu1;;
"$(gettext 'Mouse-action notice')") ln -sf /usr/local/jwm_config/menu_build_mouseaction $HOME/.jwm/root_menus/menu1;;
@@ -162,6 +163,7 @@ func_apply_mouseactions () {
case $ROOT2 in
"$(gettext 'Bookmarks menu')") ln -sf /usr/local/jwm_config/menu_build_bookmarks $HOME/.jwm/root_menus/menu2;;
"$(gettext 'Main menu')") ln -sf /usr/local/jwm_config/menu_build_main $HOME/.jwm/root_menus/menu2;;
"$(gettext 'Recently used documents')") ln -sf /usr/local/jwm_config/menu_build_recent_docs $HOME/.jwm/root_menus/menu2;;
"$(gettext 'Clock menu')") ln -sf /usr/local/jwm_config/menu_build_clock $HOME/.jwm/root_menus/menu2;;
"$(gettext 'Places menu')") ln -sf /usr/local/jwm_config/menu_build_places $HOME/.jwm/root_menus/menu2;;
"$(gettext 'Mouse-action notice')") ln -sf /usr/local/jwm_config/menu_build_mouseaction $HOME/.jwm/root_menus/menu2;;
@@ -173,6 +175,7 @@ func_apply_mouseactions () {
case $ROOT3 in
"$(gettext 'Bookmarks menu')") ln -sf /usr/local/jwm_config/menu_build_bookmarks $HOME/.jwm/root_menus/menu3;;
"$(gettext 'Main menu')") ln -sf /usr/local/jwm_config/menu_build_main $HOME/.jwm/root_menus/menu3;;
"$(gettext 'Recently used documents')") ln -sf /usr/local/jwm_config/menu_build_recent_docs $HOME/.jwm/root_menus/menu3;;
"$(gettext 'Clock menu')") ln -sf /usr/local/jwm_config/menu_build_clock $HOME/.jwm/root_menus/menu3;;
"$(gettext 'Places menu')") ln -sf /usr/local/jwm_config/menu_build_places $HOME/.jwm/root_menus/menu3;;
"$(gettext 'Mouse-action notice')") ln -sf /usr/local/jwm_config/menu_build_mouseaction $HOME/.jwm/root_menus/menu3;;
@@ -185,6 +188,7 @@ func_apply_mouseactions () {
case $ROOT4 in
"$(gettext 'Bookmarks menu')") ln -sf /usr/local/jwm_config/menu_build_bookmarks $HOME/.jwm/root_menus/menu4;;
"$(gettext 'Main menu')") ln -sf /usr/local/jwm_config/menu_build_main $HOME/.jwm/root_menus/menu4;;
"$(gettext 'Recently used documents')") ln -sf /usr/local/jwm_config/menu_build_recent_docs $HOME/.jwm/root_menus/menu4;;
"$(gettext 'Clock menu')") ln -sf /usr/local/jwm_config/menu_build_clock $HOME/.jwm/root_menus/menu4;;
"$(gettext 'Places menu')") ln -sf /usr/local/jwm_config/menu_build_places $HOME/.jwm/root_menus/menu4;;
"$(gettext 'Change desktop')")
@@ -200,6 +204,7 @@ func_apply_mouseactions () {
case $ROOT5 in
"$(gettext 'Bookmarks menu')") ln -sf /usr/local/jwm_config/menu_build_bookmarks $HOME/.jwm/root_menus/menu5;;
"$(gettext 'Main menu')") ln -sf /usr/local/jwm_config/menu_build_main $HOME/.jwm/root_menus/menu5;;
"$(gettext 'Recently used documents')") ln -sf /usr/local/jwm_config/menu_build_recent_docs $HOME/.jwm/root_menus/menu5;;
"$(gettext 'Clock menu')") ln -sf /usr/local/jwm_config/menu_build_clock $HOME/.jwm/root_menus/menu5;;
"$(gettext 'Places menu')") ln -sf /usr/local/jwm_config/menu_build_places $HOME/.jwm/root_menus/menu5;;
"$(gettext 'Change desktop')")
@@ -446,6 +451,7 @@ TMP="`readlink $HOME/.jwm/root_menus/menu1`"
case $TMP in
*bookmarks*) export ROOT_ORG1="$(gettext 'Bookmarks menu')";;
*main*) export ROOT_ORG1="$(gettext 'Main menu')";;
*recent*) export ROOT_ORG1="$(gettext 'Recently used documents')";;
*places*) export ROOT_ORG1="$(gettext 'Places menu')";;
*clock*) export ROOT_ORG1="$(gettext 'Clock menu')";;
*mouseaction*) export ROOT_ORG1="$(gettext 'Mouse-action notice')";;
@@ -455,6 +461,7 @@ TMP="`readlink $HOME/.jwm/root_menus/menu2`"
case $TMP in
*bookmarks*) export ROOT_ORG2="$(gettext 'Bookmarks menu')";;
*main*) export ROOT_ORG2="$(gettext 'Main menu')";;
*recent*) export ROOT_ORG2="$(gettext 'Recently used documents')";;
*places*) export ROOT_ORG2="$(gettext 'Places menu')";;
*clock*) export ROOT_ORG2="$(gettext 'Clock menu')";;
*mouseaction*) export ROOT_ORG2="$(gettext 'Mouse-action notice')";;
@@ -464,6 +471,7 @@ TMP="`readlink $HOME/.jwm/root_menus/menu3`"
case $TMP in
*bookmarks*) export ROOT_ORG3="$(gettext 'Bookmarks menu')";;
*main*) export ROOT_ORG3="$(gettext 'Main menu')";;
*recent*) export ROOT_ORG3="$(gettext 'Recently used documents')";;
*places*) export ROOT_ORG3="$(gettext 'Places menu')";;
*clock*) export ROOT_ORG3="$(gettext 'Clock menu')";;
*mouseaction*) export ROOT_ORG3="$(gettext 'Mouse-action notice')";;
@@ -476,6 +484,7 @@ else
case $TMP in
*bookmarks*) export ROOT_ORG4="$(gettext 'Bookmarks menu')";;
*main*) export ROOT_ORG4="$(gettext 'Main menu')";;
*recent*) export ROOT_ORG4="$(gettext 'Recently used documents')";;
*places*) export ROOT_ORG4="$(gettext 'Places menu')";;
*clock*) export ROOT_ORG4="$(gettext 'Clock menu')";;
*mouseaction*) export ROOT_ORG4="$(gettext 'Mouse-action notice')";;
@@ -489,6 +498,7 @@ else
case $TMP in
*bookmarks*) export ROOT_ORG5="$(gettext 'Bookmarks menu')";;
*main*) export ROOT_ORG5="$(gettext 'Main menu')";;
*recent*) export ROOT_ORG5="$(gettext 'Recently used documents')";;
*places*) export ROOT_ORG5="$(gettext 'Places menu')";;
*clock*) export ROOT_ORG5="$(gettext 'Clock menu')";;
*mouseaction*) export ROOT_ORG5="$(gettext 'Mouse-action notice')";;
@@ -556,6 +566,7 @@ export JWM_hotkeys='
<item>'$(gettext 'Main menu')'</item>
<item>'$(gettext 'Bookmarks menu')'</item>
<item>'$(gettext 'Places menu')'</item>
<item>'$(gettext 'Recently used documents')'</item>
<item>'$(gettext 'Clock menu')'</item>
<item>'$(gettext 'Mouse-action notice')'</item>
</comboboxtext>
@@ -569,6 +580,7 @@ export JWM_hotkeys='
<item>'$(gettext 'Main menu')'</item>
<item>'$(gettext 'Bookmarks menu')'</item>
<item>'$(gettext 'Places menu')'</item>
<item>'$(gettext 'Recently used documents')'</item>
<item>'$(gettext 'Clock menu')'</item>
<item>'$(gettext 'Mouse-action notice')'</item>
</comboboxtext>
@@ -582,6 +594,7 @@ export JWM_hotkeys='
<item>'$(gettext 'Main menu')'</item>
<item>'$(gettext 'Bookmarks menu')'</item>
<item>'$(gettext 'Places menu')'</item>
<item>'$(gettext 'Recently used documents')'</item>
<item>'$(gettext 'Clock menu')'</item>
<item>'$(gettext 'Mouse-action notice')'</item>
</comboboxtext>
@@ -595,6 +608,7 @@ export JWM_hotkeys='
<item>'$(gettext 'Main menu')'</item>
<item>'$(gettext 'Bookmarks menu')'</item>
<item>'$(gettext 'Places menu')'</item>
<item>'$(gettext 'Recently used documents')'</item>
<item>'$(gettext 'Clock menu')'</item>
<item>'$(gettext 'Change desktop')'</item>
<item>'$(gettext 'Mouse-action notice')'</item>
@@ -609,6 +623,7 @@ export JWM_hotkeys='
<item>'$(gettext 'Main menu')'</item>
<item>'$(gettext 'Bookmarks menu')'</item>
<item>'$(gettext 'Places menu')'</item>
<item>'$(gettext 'Recently used documents')'</item>
<item>'$(gettext 'Clock menu')'</item>
<item>'$(gettext 'Change desktop')'</item>
<item>'$(gettext 'Mouse-action notice')'</item>

0 comments on commit fb628e6

Please sign in to comment.
You can’t perform that action at this time.