Tree File Menu

From awesome
Jump to: navigation, search
screenshot with personalized tags
The file menu in action.

This python script creates a lua module that provides a file menu of any directory you want. It also allows you to assign programs to open the files in your menu. The script.

Installing

Copy the script to some convenient file and then edit these lines:

  1. modify the lines below accordingly

path = '/home/your-user-name/'

filetosave = open('/home/your-user-name/.config/awesome/myplacesmenu.lua', 'w')

replace your-user-name with your user name. Save and run the script. It will create a myplacesmenu.lua file in ~/.config/awesome/. To use your new file menu add:

require("myplacesmenu")

near the top of your ~/.config/awesome/rc.lua file and then add this entry to your menu.


{ "files", myplacesmenu.myplacesmenu()},

Example:

myawesomemenu = { 
   { "files", myplacesmenu.myplacesmenu()},
   { "manual", "urxvt -e man awesome" },
   { "edit config", "urxvt -e vim /home/michaelmath/.config/awesome/rc.lua.new" },
   { "restart", awesome.restart },
   { "make default", "/home/michaelmath/scripts/rcmv.sh"},
   {"debug", "urxvt -e /home/michaelmath/scripts/Awdebug.sh"},
   { "quit", awesome.quit },
   { "Log out", "/home/michaelmath/scripts/shutdown_dialog.sh"} 
}

Whenever the script is run myplacesmenu.lua will be overwritten so calling the script from your .xinitrc file could potentially cause problems as the myplacesmenu.lua might be in the process of being written while awesome is starting.

Please share

If you make any improvements to this script please share by posting a link bellow.