You are not logged in.
Info page: http://xyne.archlinux.ca/projects/obfilebrowser
Screenshot:
This is another example of what happens when I get stuck in programmer's limbo. One thing leads to another and I end up with a few hundred lines of code and a shifted sleeping schedule.
Feedback is welcome as usual.
Last edited by Xyne (2011-02-22 18:50:48)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Cool! Not sure how I'll use it, but cool!
Offline
Errors out here, because it can't find ~/.local/share/applications/defaults.list, ~/.local/share/applications/mimeinfo.cache, and /tmp/sandbox-xyne - error as follows:
Traceback (most recent call last):
File "/usr/bin/obfilebrowser", line 344, in <module>
getMenu(dpath)
File "/usr/bin/obfilebrowser", line 297, in getMenu
menu += getLauncherMenu(dpath, label='.', mimetype='x-directory/normal')
File "/usr/bin/obfilebrowser", line 176, in getLauncherMenu
log("file: " + fpath + ", mimetype: " + str(mimetype) + "\n")
File "/usr/bin/obfilebrowser", line 250, in log
f = open('/tmp/sandbox-xyne/log', 'a')
IOError: [Errno 2] No such file or directory: '/tmp/sandbox-xyne/log'
Entity: line 1: parser error : Start tag expected, '<' not found
error: unable to open /home/tomk/.local/share/applications/defaults.list
^
Openbox-Message: Invalid ouput from pipe-menu "/usr/bin/obfilebrowser /home/tomk"
Creating the two files in .local/share/applications and the dir in /tmp makes it work.
Offline
@steevols
Take a look at the code. It shouldn't be too difficult to hack in your own commands if you know Python and Openbox's menu xml. You could also play around with mimetime associations in ~/.local/share/applications to get it move functionality (let me know if you find something particularly useful). I'll add more functionality as soon as I have the time and ideas.
@tomk
I've added checks to prevent such errors. The /tmp/sandbox-xyne error was due to leftover debugging code which I've remove. Hopefully it should behave now. Thanks for letting me know.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I love it!
edit:
Strange, yesterday it worked, now I get
% obfilebrowser ~
Traceback (most recent call last):
File "/usr/bin/obfilebrowser", line 342, in <module>
getMenu(dpath)
File "/usr/bin/obfilebrowser", line 324, in getMenu
menu += getLauncherMenu(*f)
File "/usr/bin/obfilebrowser", line 209, in getLauncherMenu
for item in sorted(items, key=lambda x: x[1]):
File "/usr/bin/obfilebrowser", line 209, in <lambda>
for item in sorted(items, key=lambda x: x[1]):
IndexError: string index out of range
Last edited by Army (2009-08-04 14:24:03)
Offline
@Army
I think I've fixed this. Try the latest version and let me know if it works.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
You know, it's a little funny how you have the "Valid XHTML 1.0" image on that page, I click it, "Error found while checking this document as XHTML 1.0 Strict!"
Offline
It's not only a little funny, it's gut-busting, knee-slapping, liquid-through-the-nose hilarious. I mean, a stray ampersand in the todo section... a right hearty guffaw! Add to that the irony of an xhtml validator reporting a single error on a page which displays dynamic content and one might die of asphyxiation from the sheer absurdity of it all.
I've rectified this to prevent anyone from dying of laughter, just to avoid getting sued if nothing else.
Anyway, thanks for letting me know.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
@Army
I think I've fixed this. Try the latest version and let me know if it works.
Yes it does, thanks a lot :-)
Offline
I've added a "copy path" item to the menu. You'll need xsel for it to show up (optdep).
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
This is another example of what happens when I get stuck in programmer's limbo.
Oh, been there. And the two nodes at the bottom right are the reason I'm not a programmer. I always get stuck there, or decide "%$*! it - it works for me...".
Nice script. I'll have to give it a go when I return to OB. (I've been using standalone Compiz with the deskmenu plugin "temporarily" for about a month now, and apart from not being able to assign a key to undecorate windows, it's actually a lot like *box these days. I sometimes forget. I see threads here and think, "Hey, I'm an Openbox user... oh, wait a minute; I'm not, am I?" )
0 Ok, 0:1
Offline
sry, wrong thread...
Last edited by cl10k (2009-08-13 18:35:12)
Offline
xyne thanks for the nice application. Is there a way to hide dot and .. directories and dot files with a simple switch?. Basically hidden files should not be pulled out unless wanted .
Offline
@kgas
No, there's no way to do that currently. Can you tell me why you would even want to? "." and ".." are just for navigation (and getting a menu for the current directory) and all hidden files are sequestered to a separate menu named "hidden" so that they don't clutter the output. As the directory needs to be scanned for all files anyway, there would be no noticeable performance boost from skipping them in the output.
The only possible benefit that I can see would be to prevent casual guest users from accessing sensitive files directly via the menu, but even then it should be fairly easy to work around.
I'm open to the idea of adding a switch to skip everything beginning with ".", but I'll need a little convincing.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hi,
I'm not used with the usage of pipe-menus and I've a little trouble with getting obfilebrowser working, I've set it as pipemenu in my menu.xml and I can see and choose it but no menu is shown.
I've set this line into my menu.xml:
<menu execute="/usr/bin/obfilebrowser '/'" id="browse" label="Browse"/>
If I'm running the command manually I get xml output.
Have I forgotten something?
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline
@Andrwe
That looks correct. Can you check the output of "/usr/bin/obfilebrowser '/'" in a terminal for python errors? If you get xml output, post it here (if there's nothing private in it) and I'll try to debug it.
Try changing the initial directory too to see if the problem is connected to the root directory. If you can display another location, navigate upwards and see if what happens when you reach the root directory.
*edit*
I should also mention that umlauts and other unicode characters should cause any problems.
Last edited by Xyne (2009-09-16 04:47:41)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Can you tell me why you would even want to? "." and ".." are just for navigation
IMO with the current obfilebrowser directory list are spanned multiple times. Pl look into the attached image. Secondly the short cut is directly go the the selected directory /file what ever file is there. User may have some dot files or directories (not encrypted) which they don't want to see by their guest. I hope you might have seen this perl script which offers the switch. As yours is clean and offer additional facility to open with like thing, I feel better.
http://david.chalkskeletons.com/scripts/dirlist.pl : perl script.
In the image you can see that multiple times the desktop is appearing.
Last edited by kgas (2009-09-16 11:25:26)
Offline
@Andrwe
That looks correct. Can you check the output of "/usr/bin/obfilebrowser '/'" in a terminal for python errors? If you get xml output, post it here (if there's nothing private in it) and I'll try to debug it.
Here is the output of "obfilebrowser '/'":
<openbox_pipe_menu><separator label="dirs" /><menu id="launcher_" label="." ><separator label="Open with..." /><item label="Open Folder with Thunar"><action name="Execute"><command>Thunar "/"</command><startupnotify><enabled>yes</enabled></startupnotify></action></item><separator label="Copy..." /><item label="path"><action name="Execute"><command>/usr/bin/obfilebrowser --copy /</command></action></item><item label="mimetype"><action name="Execute"><command>/usr/bin/obfilebrowser --copy x-directory/normal</command></action></item></menu><separator /><menu id="dir_bin" label="bin" execute="/usr/bin/obfilebrowser '/bin'"/><menu id="dir_boot" label="boot" execute="/usr/bin/obfilebrowser '/boot'"/><menu id="dir_data" label="data" execute="/usr/bin/obfilebrowser '/data'"/><menu id="dir_dev" label="dev" execute="/usr/bin/obfilebrowser '/dev'"/><menu id="dir_etc" label="etc" execute="/usr/bin/obfilebrowser '/etc'"/><menu id="dir_home" label="home" execute="/usr/bin/obfilebrowser '/home'"/><menu id="dir_lib" label="lib" execute="/usr/bin/obfilebrowser '/lib'"/><menu id="dir_lib64" label="lib64" execute="/usr/bin/obfilebrowser '/lib64'"/><menu id="dir_lost+found" label="lost+found" execute="/usr/bin/obfilebrowser '/lost+found'"/><menu id="dir_media" label="media" execute="/usr/bin/obfilebrowser '/media'"/><menu id="dir_mnt" label="mnt" execute="/usr/bin/obfilebrowser '/mnt'"/><menu id="dir_opt" label="opt" execute="/usr/bin/obfilebrowser '/opt'"/><menu id="dir_proc" label="proc" execute="/usr/bin/obfilebrowser '/proc'"/><menu id="dir_root" label="root" execute="/usr/bin/obfilebrowser '/root'"/><menu id="dir_sbin" label="sbin" execute="/usr/bin/obfilebrowser '/sbin'"/><menu id="dir_scripts" label="scripts" execute="/usr/bin/obfilebrowser '/scripts'"/><menu id="dir_srv" label="srv" execute="/usr/bin/obfilebrowser '/srv'"/><menu id="dir_sys" label="sys" execute="/usr/bin/obfilebrowser '/sys'"/><menu id="dir_tmp" label="tmp" execute="/usr/bin/obfilebrowser '/tmp'"/><menu id="dir_unenc" label="unenc" execute="/usr/bin/obfilebrowser '/unenc'"/><menu id="dir_usr" label="usr" execute="/usr/bin/obfilebrowser '/usr'"/><menu id="dir_var" label="var" execute="/usr/bin/obfilebrowser '/var'"/></openbox_pipe_menu>
Here nice formatted:
<openbox_pipe_menu>
<separator label="dirs" />
<menu id="launcher_" label="." >
<separator label="Open with..." />
<item label="Open Folder with Thunar">
<action name="Execute">
<command>Thunar "/"</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
<separator label="Copy..." />
<item label="path">
<action name="Execute">
<command>/usr/bin/obfilebrowser --copy /</command>
</action>
</item>
<item label="mimetype">
<action name="Execute">
<command>/usr/bin/obfilebrowser --copy x-directory/normal</command>
</action>
</item>
</menu>
<separator />
<menu id="dir_bin" label="bin" execute="/usr/bin/obfilebrowser '/bin'"/>
<menu id="dir_boot" label="boot" execute="/usr/bin/obfilebrowser '/boot'"/>
<menu id="dir_data" label="data" execute="/usr/bin/obfilebrowser '/data'"/>
<menu id="dir_dev" label="dev" execute="/usr/bin/obfilebrowser '/dev'"/>
<menu id="dir_etc" label="etc" execute="/usr/bin/obfilebrowser '/etc'"/>
<menu id="dir_home" label="home" execute="/usr/bin/obfilebrowser '/home'"/>
<menu id="dir_lib" label="lib" execute="/usr/bin/obfilebrowser '/lib'"/>
<menu id="dir_lib64" label="lib64" execute="/usr/bin/obfilebrowser '/lib64'"/>
<menu id="dir_lost+found" label="lost+found" execute="/usr/bin/obfilebrowser '/lost+found'"/>
<menu id="dir_media" label="media" execute="/usr/bin/obfilebrowser '/media'"/>
<menu id="dir_mnt" label="mnt" execute="/usr/bin/obfilebrowser '/mnt'"/>
<menu id="dir_opt" label="opt" execute="/usr/bin/obfilebrowser '/opt'"/>
<menu id="dir_proc" label="proc" execute="/usr/bin/obfilebrowser '/proc'"/>
<menu id="dir_root" label="root" execute="/usr/bin/obfilebrowser '/root'"/>
<menu id="dir_sbin" label="sbin" execute="/usr/bin/obfilebrowser '/sbin'"/>
<menu id="dir_scripts" label="scripts" execute="/usr/bin/obfilebrowser '/scripts'"/>
<menu id="dir_srv" label="srv" execute="/usr/bin/obfilebrowser '/srv'"/>
<menu id="dir_sys" label="sys" execute="/usr/bin/obfilebrowser '/sys'"/>
<menu id="dir_tmp" label="tmp" execute="/usr/bin/obfilebrowser '/tmp'"/>
<menu id="dir_unenc" label="unenc" execute="/usr/bin/obfilebrowser '/unenc'"/>
<menu id="dir_usr" label="usr" execute="/usr/bin/obfilebrowser '/usr'"/>
<menu id="dir_var" label="var" execute="/usr/bin/obfilebrowser '/var'"/>
</openbox_pipe_menu>
Try changing the initial directory too to see if the problem is connected to the root directory. If you can display another location, navigate upwards and see if what happens when you reach the root directory.
I've tried to set the initial directory to $HOME but the result is the same.
*edit*
I should also mention that umlauts and other unicode characters should cause any problems.
I don't have any umlauts in my directory names.
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline
@kgas
You only posted the thumbnail without the link to the image so I can't read anything in it.
Nevertheless, I've added a few options:
--no-hidden
--no-parent
--no-self
Check the help message and man page for more information and let me know if it does what you want.
@Andrwe
[edit]
Update to the latest version if you don't have it already.
[/edit]
I have no idea what's wrong on your system. I am able to display your XML output in Openbox without any problems:
You can try the same test that I did. Save the following as "obtest" and make it executable:
#!/bin/bash
cat <<'OUTPUT'
<openbox_pipe_menu><separator label="dirs" /><menu id="launcher_" label="." ><separator label="Open with..." /><item label="Open Folder with Thunar"><action name="Execute"><command>Thunar "/"</command><startupnotify><enabled>yes</enabled></startupnotify></action></item><separator label="Copy..." /><item label="path"><action name="Execute"><command>/usr/bin/obfilebrowser --copy /</command></action></item><item label="mimetype"><action name="Execute"><command>/usr/bin/obfilebrowser --copy x-directory/normal</command></action></item></menu><separator /><menu id="dir_bin" label="bin" execute="/usr/bin/obfilebrowser '/bin'"/><menu id="dir_boot" label="boot" execute="/usr/bin/obfilebrowser '/boot'"/><menu id="dir_data" label="data" execute="/usr/bin/obfilebrowser '/data'"/><menu id="dir_dev" label="dev" execute="/usr/bin/obfilebrowser '/dev'"/><menu id="dir_etc" label="etc" execute="/usr/bin/obfilebrowser '/etc'"/><menu id="dir_home" label="home" execute="/usr/bin/obfilebrowser '/home'"/><menu id="dir_lib" label="lib" execute="/usr/bin/obfilebrowser '/lib'"/><menu id="dir_lib64" label="lib64" execute="/usr/bin/obfilebrowser '/lib64'"/><menu id="dir_lost+found" label="lost+found" execute="/usr/bin/obfilebrowser '/lost+found'"/><menu id="dir_media" label="media" execute="/usr/bin/obfilebrowser '/media'"/><menu id="dir_mnt" label="mnt" execute="/usr/bin/obfilebrowser '/mnt'"/><menu id="dir_opt" label="opt" execute="/usr/bin/obfilebrowser '/opt'"/><menu id="dir_proc" label="proc" execute="/usr/bin/obfilebrowser '/proc'"/><menu id="dir_root" label="root" execute="/usr/bin/obfilebrowser '/root'"/><menu id="dir_sbin" label="sbin" execute="/usr/bin/obfilebrowser '/sbin'"/><menu id="dir_scripts" label="scripts" execute="/usr/bin/obfilebrowser '/scripts'"/><menu id="dir_srv" label="srv" execute="/usr/bin/obfilebrowser '/srv'"/><menu id="dir_sys" label="sys" execute="/usr/bin/obfilebrowser '/sys'"/><menu id="dir_tmp" label="tmp" execute="/usr/bin/obfilebrowser '/tmp'"/><menu id="dir_unenc" label="unenc" execute="/usr/bin/obfilebrowser '/unenc'"/><menu id="dir_usr" label="usr" execute="/usr/bin/obfilebrowser '/usr'"/><menu id="dir_var" label="var" execute="/usr/bin/obfilebrowser '/var'"/></openbox_pipe_menu>
OUTPUT
Run it to make sure that it works and then try adding this to the Openbox menu (obviously after changing "/path/to/obtest")
<menu id="obtest" label="test" execute="/path/to/obtest" />
If that works then the error should be in your menu file somewhere. Try changing the id and label of your obfilebrowser menu or move it around in the menu file.
If it still doesn't work, post your menu.xml and I'll try to debug it.
Last edited by Xyne (2009-09-16 22:37:48)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
obtest is shown perfectly but I don't get any result if I choose one directory.
Here is my menu.xml:
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="apps-editors-menu" label="Editor">
<item label="Geany">
<action name="Execute">
<execute>
geany
</execute>
</action>
</item>
</menu>
<menu id="apps-accessories-menu" label="Accessories">
<item label="GCalctool">
<action name="Execute">
<execute>
gcalctool
</execute>
</action>
</item>
<item label="XArchiver">
<action name="Execute">
<execute>
xarchiver
</execute>
</action>
</item>
</menu>
<menu id="apps-term-menu" label="Terminals">
<item label="urxvtc">
<action name="Execute">
<execute>
/home/alw/.config/openbox/urxvtc
</execute>
</action>
</item>
<item label="Xterm">
<action name="Execute">
<command>
xterm
</command>
</action>
</item>
</menu>
<menu id="apps-net-menu" label="Internet">
<item label="Firefox">
<action name="Execute">
<command>
firefox
</command>
<startupnotify>
<enabled>
yes
</enabled>
<wmclass>
Firefox
</wmclass>
</startupnotify>
</action>
</item>
<item label="irssi">
<action name="Execute">
<execute>
/scripts/irssi
</execute>
</action>
</item>
<item label="Mumble">
<action name="Execute">
<execute>
mumble
</execute>
</action>
</item>
<item label="Skype">
<action name="Execute">
<execute>
schroot skype
</execute>
</action>
</item>
<item label="Thunderbird">
<action name="Execute">
<execute>
thunderbird
</execute>
</action>
</item>
</menu>
<menu id="apps-office-menu" label="Office">
<item label="VirtualBox">
<action name="Execute">
<execute>
VirtualBox
</execute>
</action>
</item>
<item label="OpenOffice Base">
<action name="Execute">
<command>
soffice -base
</command>
</action>
</item>
<item label="OpenOffice Calc">
<action name="Execute">
<command>
soffice -calc
</command>
</action>
</item>
<item label="OpenOffice Draw">
<action name="Execute">
<command>
soffice -draw
</command>
</action>
</item>
<item label="OpenOffice Impress">
<action name="Execute">
<command>
soffice -impress
</command>
</action>
</item>
<item label="OpenOffice Math">
<action name="Execute">
<command>
soffice -math
</command>
</action>
</item>
<item label="OpenOffice Printer Administration">
<action name="Execute">
<command>
soffice-printeradmin
</command>
</action>
</item>
<item label="OpenOffice Writer">
<action name="Execute">
<command>
soffice -writer
</command>
</action>
</item>
</menu>
<menu id="apps-multimedia-menu" label="Multimedia">
<item label="Avidemux">
<action name="Execute">
<execute>
avidemux2_gtk
</execute>
</action>
</item>
<item label="EasyTag">
<action name="Execute">
<execute>
easytag
</execute>
</action>
</item>
<item label="Graveman">
<action name="Execute">
<execute>
graveman
</execute>
</action>
</item>
<item label="MediaInfo">
<action name="Execute">
<execute>
mediainfo-gui
</execute>
</action>
</item>
</menu>
<menu id="apps-fileman-menu" label="File Managers">
<item label="Thunar">
<action name="Execute">
<command>
Thunar
</command>
<startupnotify>
<enabled>
yes
</enabled>
</startupnotify>
</action>
</item>
</menu>
<menu id="games" label="Games">
<item label="Guild Wars">
<action name="Execute">
<execute>
/home/alw/games/gw
</execute>
</action>
</item>
</menu>
<menu id="apps-graphics-menu" label="Graphics">
<item label="Dia Diagram Editor">
<action name="Execute">
<command>
dia
</command>
<startupnotify>
<enabled>
yes
</enabled>
</startupnotify>
</action>
</item>
<item label="feh">
<action name="Execute">
<execute>
feh
</execute>
</action>
</item>
<item label="Gimp">
<action name="Execute">
<command>
gimp
</command>
<startupnotify>
<enabled>
yes
</enabled>
</startupnotify>
</action>
</item>
</menu>
<menu id="system-menu" label="System">
<item label="Obkey">
<action name="Execute">
<execute>
obkey
</execute>
</action>
</item>
<item label="Obmenu">
<action name="Execute">
<execute>
obmenu
</execute>
</action>
</item>
<item label="Openbox Configuration Manager">
<action name="Execute">
<command>
obconf
</command>
<startupnotify>
<enabled>
yes
</enabled>
</startupnotify>
</action>
</item>
<item label="Manage Cups Printers">
<action name="Execute">
<command>
xdg-open http://localhost:631/
</command>
<startupnotify>
<enabled>
no
</enabled>
<icon>
cups
</icon>
</startupnotify>
</action>
</item>
<separator/>
<item label="Reconfigure Openbox">
<action name="Reconfigure"/>
</item>
<item label="Exit Openbox">
<action name="Exit">
<prompt>
yes
</prompt>
</action>
</item>
</menu>
<menu id="root-menu" label="Openbox 3">
<menu execute="/usr/bin/obfilebrowser '/'" id="browsen" label="Browse"/>
<menu execute="/home/alw/obtest" id="browse_test" label="Browsetest"/>
<separator label="Applications"/>
<menu id="apps-accessories-menu"/>
<menu id="apps-editors-menu"/>
<menu id="games"/>
<menu id="apps-graphics-menu"/>
<menu id="apps-net-menu"/>
<menu id="apps-office-menu"/>
<menu id="apps-multimedia-menu"/>
<menu id="apps-term-menu"/>
<menu id="apps-fileman-menu"/>
<separator label="System"/>
<menu id="system-menu"/>
<separator/>
<item label="Log out">
<action name="Execute">
<execute>
oblogout
</execute>
</action>
</item>
</menu>
</openbox_menu>
Is maybe something needed to use pipemenus which I'm missing?
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline
@Andrwe
I have no idea what's wrong with your setup. I tested your menu.xml by replacing my own with it and the obfilebrowser menu under Browse displays at the top of the root menu without any errors as do all submenus. This means that your menu.xml files is correct.
The output from the obfilebrowser command that you posted also works on your system, which means that the output is correct as well.
The only other idea that I have is to try to display the menu again then switch to the login terminal with ctrl+alt+f1 (or f2, f3, etc) to see if there are any errors (ctrl+alt+f7 to get back to X).
Last edited by Xyne (2009-09-16 23:29:30)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thanks, Xyne. I will test and come back.
Hello Xyne, This is what I expected. Keep your good work.
Thanks once again...
Last edited by kgas (2009-09-17 13:26:08)
Offline
@Xyne
I found something interesting.
When I start obfilebrowser from menu like this:
/bin/bash --login -c 'obfilebrowser /'
I get all directories of the initial one but I don't get the subdirectories.
Unfortunately I don't have a clue at the moment why.
Do you have an idea?
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline
YEAH, I got it
I've fixed all malfunctional apps of my system finaly *PAAAAARTYYYYYYYYY*
Thanks to obfilebrowser I found out that my openbox session wasn't started as bash session.
This was the reason why obfilebrowser didn't work.
Website: andrwe.org
Repository: repo.andrwe.org/<archtiecture>
Offline