You are not logged in.
@Andrwe
Nice!
I'm really glad that you found the source of the problem. I really had no idea what it could be.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Great work, but I use WindowMaker.
So, totally inspired by your ObFilebrowser I have created wmFileBrowser for WindowMaker. It works exactly like ObFilebrowser (it's nearly the same code), but it creates the necessary menu structure (which is totally different than openbox's menu) for WindowMaker.
I will release it this evening or tomorrow and will announce it in a seperate thread.
Thanks a lot for this great inspiration! It's great to browse the filesystem this way.
Daniel
Offline
Thanks a lot for this great inspiration! It's great to browse the filesystem this way.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
@Xyne: The menu-file-browser looks nice, i'll give it a try too...(i just trashed my windows-installation again with a huge smile). It's a bit offtopic, but what i'm more interested in at the moment: I like the font and the openbox-theme in the screenshot of your very first post in this thread. What's the name of the font, and is the theme a public one?
Thanks!
Offline
It's a bit offtopic, but what i'm more interested in at the moment: I like the font and the openbox-theme in the screenshot of your very first post in this thread. What's the name of the font, and is the theme a public one?
Thanks!
The font is "snap" from the "artwiz-fonts" package and the theme is a modified version of MurrinaAngustifolium:
#openbox themerc edited with obtheme
border.width: 1
menu.border.color: #101010
menu.items.active.bg: Flat Gradient SplitVertical
menu.items.active.bg.color: #2c2c2c
menu.items.active.bg.colorTo: #101010
menu.items.active.disabled.text.color: #c3c3c3
menu.items.active.text.color: #56AAFF
menu.items.bg: Flat Solid
menu.items.bg.color: #1a1a1a
menu.items.disabled.text.color: #999999
menu.items.font: shadow=n
menu.items.text.color: #cccccc
menu.overlap: -5
menu.separator.color: #56AAFF
menu.title.bg: Flat Gradient SplitVertical
menu.title.bg.color: #2c2c2c
menu.title.bg.colorTo: #101010
menu.title.text.color: #56AAFF
menu.title.text.font: shadow=n
menu.title.text.justify: Right
osd.bg: Gradient SplitVertical Raised
osd.bg.color: #2B2B2B
osd.bg.colorTo: #1A1A1A
osd.bg.border.color: #0B0B0B
osd.label.bg: parentrelative
osd.label.text.color: #bbbbbb
padding.width: 1
window.active.button.disabled.bg: Flat Gradient Vertical Border
window.active.button.disabled.bg.color: #1a1a1a
window.active.button.disabled.bg.colorTo: #1a1a1a
window.active.button.disabled.bg.border.color: #1a1a1a
window.active.button.disabled.image.color: #c0c0c0
window.active.button.hover.bg: Flat Gradient SplitVertical Border
window.active.button.hover.bg.color: #303030
window.active.button.hover.bg.colorTo: #000000
window.active.button.hover.bg.border.color: #101010
window.active.button.hover.image.color: #56AAFF
window.active.button.pressed.bg: Flat Gradient Vertical Border
window.active.button.pressed.bg.color: #1a1a1a
window.active.button.pressed.bg.colorTo: #1a1a1a
window.active.button.pressed.bg.border.color: #1a1a1a
window.active.button.pressed.image.color: #ffffff
window.active.button.toggled.image.color: #c0c0c0
window.active.button.unpressed.bg: Flat Gradient SplitVertical Border
window.active.button.unpressed.bg.color: #2c2c2c
window.active.button.unpressed.bg.colorTo: #000000
window.active.button.unpressed.bg.border.color: #101010
window.active.button.unpressed.image.color: #cccccc
window.active.client.color: #56AAFF
window.active.grip.bg: Flat Gradient Vertical
window.active.grip.bg.color: #1a1a1a
window.active.grip.bg.colorTo: #1a1a1a
window.active.handle.bg: Flat Gradient Vertical
window.active.handle.bg.color: #1a1a1a
window.active.handle.bg.colorTo: #1a1a1a
window.active.label.bg: Parentrelative
window.active.label.text.color: #ffffff
window.active.label.text.font: shadow=n
window.active.title.bg: Flat Gradient SplitVertical
window.active.title.bg.color: #2c2c2c
window.active.title.bg.colorTo: #1a1a1a
window.client.padding.width: 0
window.handle.width: 1
window.inactive.border.color: #1a1a1a
window.inactive.button.disabled.bg: Flat Gradient Vertical Border
window.inactive.button.disabled.bg.color: #1a1a1a
window.inactive.button.disabled.bg.colorTo: #1a1a1a
window.inactive.button.disabled.bg.border.color: #1a1a1a
window.inactive.button.disabled.image.color: #1a1a1a
window.inactive.button.hover.bg: Flat Gradient SplitVertical Border
window.inactive.button.hover.bg.color: #2c2c2c
window.inactive.button.hover.bg.colorTo: #1a1a1a
window.inactive.button.hover.bg.border.color: #1a1a1a
window.inactive.button.hover.image.color: #aaaaaa
window.inactive.button.pressed.bg: Flat Gradient Vertical Border
window.inactive.button.pressed.bg.color: #1a1a1a
window.inactive.button.pressed.bg.colorTo: #1a1a1a
window.inactive.button.pressed.bg.border.color: #1a1a1a
window.inactive.button.pressed.image.color: #1a1a1a
window.inactive.button.toggled.image.color: #1a1a1a
window.inactive.button.unpressed.bg: Flat Gradient SplitVertical Border
window.inactive.button.unpressed.bg.color: #222222
window.inactive.button.unpressed.bg.colorTo: #1a1a1a
window.inactive.button.unpressed.bg.border.color: #1a1a1a
window.inactive.button.unpressed.image.color: #333333
window.inactive.client.color: #1a1a1a
window.inactive.grip.bg: Flat Gradient Vertical
window.inactive.grip.bg.color: #1a1a1a
window.inactive.grip.bg.colorTo: #1a1a1a
window.inactive.handle.bg: Flat Gradient Vertical
window.inactive.handle.bg.color: #1a1a1a
window.inactive.handle.bg.colorTo: #1a1a1a
window.inactive.label.bg: Parentrelative
window.inactive.label.text.color: #888888
window.inactive.label.text.font: shadow=n
window.inactive.title.bg: Flat Gradient SplitVertical
window.inactive.title.bg.color: #222222
window.inactive.title.bg.colorTo: #1a1a1a
window.label.text.justify: center
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hey, I just downloaded the source from the aur page (being that I'm a gentoo user). And when i try to run it, it gives me the following error:
$ python obfilebrowser
Traceback (most recent call last):
File "obfilebrowser", line 36, in <module>
lang_code = locale.getdefaultlocale()[0].split(' ', 1)
AttributeError: 'NoneType' object has no attribute 'split'
And being that I've never programmed in python, I'm not too sure what to do about this error :-)
Offline
@zeerak
It seems that your locale isn't set, at least not as far as Python is concerned. I've added a check to set a default locale (and fixed an unrelated bug on that line ).
Let me know if it works with the latest version.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
hmm unfortunately that didn't do it.
$ python obfilebrowser
Traceback (most recent call last):
File "obfilebrowser", line 38, in <module>
lang_code = locale.getdefaultlocale()[0].split(' ', 1)
AttributeError: 'NoneType' object has no attribute 'split'
strange strange, how would I set the locale to satisfy python? I know I did set some locales a while ago :-)
Offline
I don't know how to configure the system get Python to recognize the locale, at least not on Gentoo. You would probably have better luck asking on the Gentoo forum. You can mention that I'm using the standard locale module to get the locale.
I've put that code inside of a try/except block, so it should work now, although it will default to en_US if it fails to detect the system's locale.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Ah the current version did it. :-)
It works, I didn't get to test with 0.7.3, but what I did was check my /etc/locale.gen was as it should be, and then I ran locale-gen. A shower seem to waken my brain :-)
So yes, it should work, and now the next person with a similar problem can try checking up on their locales :-)
thanks
Offline
It just hit me that while I can run the program with python, that's not the point of it. there isn't a configure file, so installing it as a binary that's run gets a little hard ;-) Do you have the time to do the honours?
Last edited by zeerak (2010-01-30 13:59:15)
Offline
Doh, the previous was just me being stupid, there is something strange though.
If I set the directory to be ~/ then I get no output, if i set it to another directory, say ~/Downloads I get all my directories, I can't access any of them asides from one. A hidden directory, the rest won't show the subdirectory. If I create a directory ~/test and move everything in ~/ into that, it'll output test and hidden directories. Again, it shows what's in the hidden directories but not in the regular directories... I've browsed through the code, and it doesn't seem that there is anything obvious creating this glitch, yet my knowledge of python is already stated as very limited :-)
Offline
Can you run the following command in a console and post the output?
obfilebrowser ~
It should let me track down the error.
Sorry that I missed your previous post.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
it's a lot of output so i'm just pastebinning it :-)
This is messy:
http://zeerak.pastebin.com/mad55dbf
And this is clean:
http://zeerak.pastebin.com/m6ec4d612
Hope you can help, and no worries about it :-)
Offline
Sorry, I saw "home" in the menu and thought "~" instead of "/home". I should have requested the output of
obfilebrowser /home
and maybe even
obfilebrowser /
The xml generated for you home directory works as expected.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
But aren't you supposed to be able to look into subdirectories with obfilebrowser?
output of / :
http://zeerak.pastebin.com/m4916448
output of /home :
http://zeerak.pastebin.com/m639597a8
Screenshot of when it's set to /home:
http://omploader.org/vM2Y1Mw
http://omploader.org/vM2Y1NQ
and of / along with the line in menu.xml:
http://omploader.org/vM2Y1Nw
Hope it helps in finding out whether it's working as it should be, and if not, what can be done about it :-)
Offline
bingo!
The problem was that you hadn't made obfilebrowser executable. The first invocation worked because you invoked it with python but subsequent recursive invocations to open subdirectories failed because it tried to invoke itself directly.
I've updated the code to check if it's executable and to prepend "python " to the command if it isn't.
Thanks for posting all of the output and screenshots. I was expecting it to be some obscure xml formatting error... it would have taken me ages to realize that it wasn't executable.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
It woorks it woooorks :-)
Thank you :-) And if you don't mind, I might be writing an ebuild for gentoo :-)
Last edited by zeerak (2010-02-02 19:40:48)
Offline
I like mine more
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4
# CC-by-sa, Dirk Sohler, spam@0x7be.de
# Command to open files and folders with. Must be something that reads the
# MIME data and opens the correct application. On my system PCManFM does
# that very well. You might want to input "xdg-open" here
cmd = 'pcmanfm "%s"'
# The header text. This text is shown above all submenus. %s will be replaced
# with the actual folder name.
open = 'Open %s'
# Here we go
import os,sys,glob
def isort(folder):
# SCREW THAT SHIT! Why is there no case-insensitive sorting method?
tl = [(x.lower(), x) for x in folder]
tl.sort()
return [x[1] for x in tl]
def clean(str):
esc = {
'&': '&',
'"': '"',
'\'': ''',
'>': '>',
'<': '<'
}
return "".join(esc.get(c,c) for c in str)
def printfolders(folders):
if (len(folders) > 0):
print '<separator />'
for folder in isort(folders):
bn = clean(os.path.basename(folder))
print ('<menu id="obrowse-%s" label="%s" execute="%s" />'
% (bn.lower(), bn, sys.argv[0]+' "'+clean(folder)+'"'))
def printfiles(files):
if (len(files) > 0):
print '<separator />'
for file in isort(files):
print (('<item label="%s"><action name="Execute">'+
'<command>'+cmd+'</command></action></item>')
% (clean(os.path.basename(file)),clean(file)))
def main():
print '<openbox_pipe_menu>'
files = []
folders = []
for item in glob.glob(os.path.join(sys.argv[1], '*')):
if os.path.isdir(item) == True:
folders.append(item)
else:
files.append(item)
print (('<item label="'+open+'"><action name="Execute">'+
'<command>'+cmd+'</command></action></item>')
% (clean(os.path.basename(sys.argv[1])),(clean(sys.argv[1]))))
printfolders(folders)
printfiles(files)
print '</openbox_pipe_menu>'
if __name__ == '__main__':
main()
Last edited by Dirk Sohler (2010-03-13 02:41:53)
Offline
obfilebrowser doesn't seem to run anymore in my OB menu.
If I run it in a terminal like
obfilebrowser ~
I get:
Traceback (most recent call last):
File "/usr/bin/obfilebrowser", line 456, in <module>
main()
File "/usr/bin/obfilebrowser", line 448, in main
defaults, mimeinfo, desktops = loadMimeinfo()
File "/usr/bin/obfilebrowser", line 132, in loadMimeinfo
defaults = getDefaultsList(homeApps + '/defaults.list', defaults)
File "/usr/bin/obfilebrowser", line 83, in getDefaultsList
mimetype, desktop = map(lambda x: x.strip(), line.split('=', 1))
ValueError: need more than 1 value to unpack
Same result with every directory I try.
Offline
@daneel971
Your defaults list may be corrupted. The file is located at ~/.local/share/applications/defaults.list
It should contain a default applications section in the following format:
[Default Applications]
application/x-perl=medit.desktop
application/x-python=medit.desktop
It seems that you have a line in that section without a right-hand side, e.g. "application/x-foo". If you do, remove it and try obfilebrowser again. If it works, try to determine which application broke the list (obfilebrowser doesn't modify that file).
If you can't find anything wrong with the file, post it so that I can check it.
How do you set the default applications? (pcmanfm? mimeman? other DE tool?)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Your defaults list may be corrupted.
Many thanks
There was a blank line at the end of the file. I deleted it and now all is working.
I probably edited the file myself without suspecting that a blank line would cause troubles.
Offline
That's partly my fault then. I've updated the code to handle blank lines and other exceptions.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I want to toss in my obrowse again
Last edited by Dirk Sohler (2010-04-20 17:27:55)
Offline