You are not logged in.

#1 2009-03-03 10:20:48

Wintervenom
Member
From: /home/wintervenom
Registered: 2008-08-20
Posts: 1,011
Website

Dmen File Manager

A simple dmenu-based file manager.

Screenshots:
vMWJrcg.png
vMWJrcw.png
vMWJrdA.png

Download:  http://aur.archlinux.org/packages.php?ID=24386

Let me know if I can improve/correct anything.

Last edited by Wintervenom (2009-03-03 10:21:20)


My [GitHub] and my [artwork].
Data is guaranteed to stay crunchy in milk.
Keep your _✍ hand strong.

Offline

#2 2009-03-03 10:26:07

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: Dmen File Manager

Nice so far.  One thing, which is personal pref more than anything, can you have .dmenfm go in ~/.config instead of ~/?  I might be wrong in thinking this, but that seems to be the place config files should go. hmm


dnyy in IRC & Urban Terror

Offline

#3 2009-03-03 13:58:30

ludovico
Member
From: Oslo, Norway
Registered: 2008-08-24
Posts: 75

Re: Dmen File Manager

Nice idea, thank you! I use dwm and dmenu, and usually I just use bash for file management, but this works great for simple tasks smile

One thing though, how do you change the default apps? I don't want my images to be opened in GIMP by default...


Sin? What's all this about sin?

Offline

#4 2009-03-03 15:25:29

koch
Member
From: Germany
Registered: 2008-01-26
Posts: 369

Re: Dmen File Manager

nice. i like it. how can i change colors?

Offline

#5 2009-03-03 15:30:09

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Dmen File Manager

I will try it out in a moment. I don't want to install exo though. Is all exo does determine what program to run on the file based on its name?

Offline

#6 2009-03-03 15:40:44

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Dmen File Manager

Whoah! Looks like a nice one wink


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#7 2009-03-03 15:48:06

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Dmen File Manager

koch wrote:

nice. i like it. how can i change colors?

Change the line in the script that sets the dmenu_params:

dmenu_params="-i -b -nb #000000 -nf #9999CC -sb #000066"

archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#8 2009-03-03 16:00:18

djnm
Member
From: USA
Registered: 2008-12-21
Posts: 78

Re: Dmen File Manager

Can I move it to the top of the screen? and I cannot use "urxvtc -e vim" as my editor

Great work though!

EDIT: Got it to the top tongue

Last edited by djnm (2009-03-03 16:01:36)


br0tat0chip in #archlinux and on freenode

Offline

#9 2009-03-03 16:25:34

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Dmen File Manager

Nice little tool.... Can we have an option to open the current directory in a file browser? An option like [open] after [preferences], selecting which will open the current directory in a file browser...


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#10 2009-03-03 17:11:48

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Dmen File Manager

Looks great, will definitely try out. smile

Just out of curiosity: Would it be possible to use MIME types for choosing an application to open files with? (Or , for that matter, any other external app which doesn't depend on some kind of DE?)

Offline

#11 2009-03-03 18:27:03

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Dmen File Manager

I converted .pyfmiirc to a bash script that does what you want.

It can take over all view, edit and exec tasks

#! /bin/bash
#usage: ./autoprogramselector (view|edit|exec) filename

if [ $1 = help -o $1 = "-h" -o $1 = "--help" ]; then grep -E '^(#|view|edit|exec)' $0; exit 0; fi
if [ $# -ne 2 ]; then echo wrong usage; exit 1; fi

#source 
if [[ $2 =~ \.([ch]|txt|sh|s)$ ]]; then
view="gvim $2"
edit="gvim $2"
exec=""

#man     
elif [[ $2 =~ \.[0-9](\.gz)?$ ]]; then
view="xman $2"
edit="gvim $2"
exec="xman $2"

#archive 
elif [[ $2 =~ \.(tar|gz|rar|zip|7z|lha|bz2|tgz)$ ]]; then
view="atool -l $2"
edit=""
exec="atool -x $2"

#video 
elif [[ $2 =~ \.(mkv|mpe?g|avi|mp4|wmv|rmvb|as[fx]|divx|vob|ogm|ra?m|flv|part|iso)$ ]]; then
view="mplayer $2"
edit=""
exec="mplayer $2"

#audio 
elif [[ $2 =~ \.(mp3|wav|ogg)$ ]]; then
view="mplayer $2"
edit=""
exec="mplayer $2"

#torrent 
elif [[ $2 =~ \.torrent ]]; then
view=""
edit=""
exec=""

#pdf     
elif [[ $2 =~ \.(pdf|ps)$ ]]; then
view="xpdf $2"
edit=""
exec="xpdf $2"

#image 
elif [[ $2 =~ \.(jpe?g|png|gif|tiff|bmp|icon)$ ]]; then
view="feh $2"
edit="mtpaint $2"
exec="feh $2"

#html     
elif [[ $2 =~ \.(html?|swf)$ ]]; then
view="firefox $2"
edit="gvim $2"
exec="firefox $2"

#document 
elif [[ $2 =~ \.(doc|rtf)$ ]]; then
view=""
edit=""
exec="abiword $2"

#windows 
elif [[ $2 =~ \.exe$ ]]; then
view=""
edit=""
exec="wine $2"

#regular file
else
view="gvim $2"
edit="gvim $2"
exec="gvim $2"
fi

#executable (overrides)
if [ -x "$2" ]; then
exec="$2"
fi

#make it so
if [ -n "${!1}" ]; then
setsid setsid ${!1}
fi

EDIT NB: the setsid setsid is not good for console, but it is good for using it from an X11 app.

Last edited by Procyon (2009-03-03 18:37:31)

Offline

#12 2009-03-03 21:37:59

Wintervenom
Member
From: /home/wintervenom
Registered: 2008-08-20
Posts: 1,011
Website

Re: Dmen File Manager

Updated.  Now, you can change the executor to something other than exo-open or gnome-open to have another program deal with opening files in the applications you want them to.  You can also write plug-ins to extend functionality a bit.  Dmen will look for these in $XDG_CONFIG_HOME/dmenfm/plugins in three directories:  browser (appended to the file browser -- you probably want to put brackets around the filenames of these), operations (appended to the operations menu), and preferences (appended to preferences menu).  The file name of the plug-in will be what is displayed in the respective menu.  Plug-ins are source'd, so they can use Dmen's variables.

### Changelog #####################################################
# 0.1.0 # * Initial version                                       #
# 0.1.1 # + Option 'Open last used dir'                           #
#       # + Options 'Always open dirs' and 'Always open files'    #
# 0.1.2 # + Config moved to $XDG_CONFIG_HOME                      #
#       # + Options for dmenu styling                             #
#       # + Option to change executor                             #
#       # + Option to open file manager in current directory      #
#       # + Plugins support                                       #
###################################################################

Last edited by Wintervenom (2009-03-04 08:39:07)


My [GitHub] and my [artwork].
Data is guaranteed to stay crunchy in milk.
Keep your _✍ hand strong.

Offline

#13 2009-03-03 22:59:11

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: Dmen File Manager

Thanks a bunch for stickin' it in ~/.config, you have no idea how much I wish every app would do that.


dnyy in IRC & Urban Terror

Offline

#14 2009-03-04 08:37:45

Wintervenom
Member
From: /home/wintervenom
Registered: 2008-08-20
Posts: 1,011
Website

Re: Dmen File Manager

Here's a few plug-in to try.

#!/bin/bash

### Application Launch Plug-in for DmenFM ##########################
# Version 0.1.0 by Scott Garrett <wintervenom [(a)] archlinux.us>  #
####################################################################

### Description ####################################################
# An application launcher that allows you choose by application or #
# executable name.                                                 #
# The executor you have set must know how to open *.desktop files. #
####################################################################

### To Use... ######################################################
# Place this plug-in in "$XDG_CONFIG_HOME/dmenfm/plugins/browser". #
####################################################################

apps_dir='/usr/share/applications'

opt=$(((grep -h "^Name=" $apps_dir/*.desktop | sed 's:Name=::'); dmenu_path) | $menu)
if [ "$opt" ]; then
    file=$(grep -l "^Name=$opt$" $apps_dir/*.desktop)
    if [ $file ]; then
        if [[ $(echo "$file" | wc -l) > 1 ]]; then
            file="$apps_dir/$(echo "$file" | sed "s:${apps_dir}/::" | $menu -p "Which $opt?")"
        fi
        if [ "$executor" ] && which "$executor" &> /dev/null; then
            exec "$executor" "$file" &
            unset file
        elif which exo-open &> /dev/null; then
            exo-open "$file"
            unset file
        elif gnome-open &> /dev/null; then
            gnome-open "$file"
            unset file
        else
            xmessage 'No executor found.  Set one in [Preferences].'
        fi
    else
        which "$opt" &> /dev/null && exec "$opt" &
        unset file
    fi
fi
#!/bin/bash

### Secure Delete Plug-in for DmenFM ###############################
# Version 0.1.0 by Scott Garrett <wintervenom [(a)] archlinux.us>  #
####################################################################

### Description ####################################################
# Uses 'srm' to securely erase files and directories.              #
####################################################################

### To Use... ######################################################
# Place plug-in in "$XDG_CONFIG_HOME/dmenfm/plugins/operations".   #
####################################################################

if which srm &> /dev/null; then
    opt=$(echo "No
Yes: DoD (7-pass)
Yes: BSD (3-pass)
Yes: single pass" | $menu -p "Secure delete <$file>?")
    [[ "$opt" =~ 'Yes' ]] && srm -rf $([[ "$opt" =~ 'DoD' ]] && echo '-D') $([[ "$opt" =~ 'BSD' ]] && echo '-P') $([[ "$opt" =~ 'single' ]] && echo '-s') "$file"
else
    echo 'OK' | $menu -p 'This requires the srm utility.'
fi
#!/bin/bash

### Gompload Plug-in for DmenFM ####################################
# Version 0.1.0 by Scott Garrett <wintervenom [(a)] archlinux.us>  #
####################################################################

### Description ####################################################
# Uploads files to Omploader using gompload (gomploader).          #
####################################################################

### To Use... ######################################################
# Place plug-in in "$XDG_CONFIG_HOME/dmenfm/plugins/operations".   #
####################################################################

opt=$(echo -e "No\nYes" | $menu -p "Gompload <$file>?")
if [[ "$opt" == "Yes" ]]; then
    if which gompload &> /dev/null; then
        gompload "$file"
    else
        echo 'OK' | $menu -p 'This requires gompload(er) utility.'
    fi
fi
#!/bin/bash

### Clear File Plug-in for DmenFM ##################################
# Version 0.1.0 by Scott Garrett <wintervenom [(a)] archlinux.us>  #
####################################################################

### Description ####################################################
# Clears file contents.  *** Recursive on directories. ***         #
####################################################################

### To Use... ######################################################
# Place plug-in in "$XDG_CONFIG_HOME/dmenfm/plugins/operations".   #
####################################################################

opt=$(echo -e "No\nYes" | $menu -p "Clear <$file>?")
if [[ "$opt" == "Yes" ]]; then
    if [ -d "$file" ]; then
        find "$file" -type f | while read dfile; do
            echo > "$dfile"
        done
    else
        echo > "$file"
    fi
fi

Last edited by Wintervenom (2009-03-04 09:18:10)


My [GitHub] and my [artwork].
Data is guaranteed to stay crunchy in milk.
Keep your _✍ hand strong.

Offline

#15 2009-03-04 17:29:24

koch
Member
From: Germany
Registered: 2008-01-26
Posts: 369

Re: Dmen File Manager

rson451 wrote:
koch wrote:

nice. i like it. how can i change colors?

Change the line in the script that sets the dmenu_params:

dmenu_params="-i -b -nb #000000 -nf #9999CC -sb #000066"

thanks, found it. i was blind. wink

new features look very nice.

Offline

#16 2009-03-04 17:50:16

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Dmen File Manager

Wow, awesome! Thanks for implementing. Now I just need some equally awesome executor...

Dmenfm, enjoy your stay on my harddisk.

Offline

#17 2009-03-04 22:51:15

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: Dmen File Manager

Amazing! Can't believe you've done all this using a single bash script. smile

Also, Is there any chance for utf-8 support? Currently, file name with non-latin character in it is all mess up.


Memento mori

Offline

#18 2009-03-04 23:33:32

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Dmen File Manager

zodmaner wrote:

Amazing! Can't believe you've done all this using a single bash script. smile

Also, Is there any chance for utf-8 support? Currently, file name with non-latin character in it is all mess up.

You have to select a font that has iso10646 e.g. "-*-fixed-medium-r-normal-*-15-*"

Offline

#19 2009-03-08 00:36:57

Wintervenom
Member
From: /home/wintervenom
Registered: 2008-08-20
Posts: 1,011
Website

Re: Dmen File Manager

To be added or changed in version 0.1.3:
- "Set font" option added (forgot to put that back in, sorry)
- Run as administrator
- Shortcuts
- Localization support
- Application launcher will be built-in
- Better plug-in support
- Global plug-ins directory will be added (this would let you install them from the AUR)

Might get added to 0.1.3:
- Media management (won't depend on HAL, but will use it if it is available)
- Filter by file name/type

Possible future plug-ins:
- Browse for files on web pages and FTP directories
- Browse network shares (this might or might not make it to 0.1.3)
- Window management

Last edited by Wintervenom (2009-03-08 00:39:26)


My [GitHub] and my [artwork].
Data is guaranteed to stay crunchy in milk.
Keep your _✍ hand strong.

Offline

#20 2009-03-08 10:08:26

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: Dmen File Manager

Great work. I like it a lot. Just installed it and am using it in my dwm and wmii both.

The only issue is that i have to change the Default on bottom every time i switch WMs smile

But I am still weighing my options between dwm and wmii.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#21 2009-03-08 10:27:58

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Dmen File Manager

Inxsible wrote:

Great work. I like it a lot. Just installed it and am using it in my dwm and wmii both.

The only issue is that i have to change the Default on bottom every time i switch WMs smile

But I am still weighing my options between dwm and wmii.

A bit offtopic, but have you tried XMonad ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#22 2009-03-08 10:33:04

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: Dmen File Manager

moljac024 wrote:
Inxsible wrote:

Great work. I like it a lot. Just installed it and am using it in my dwm and wmii both.

The only issue is that i have to change the Default on bottom every time i switch WMs smile

But I am still weighing my options between dwm and wmii.

A bit offtopic, but have you tried XMonad ?

No I haven't. dwm and wmii are the only tiling WMs that i have tried. I did try awesome from the repos, but unfortunately i couldn't do much with it so I removed it thinking I would try the git version...but havent come around to it yet, because i got busy with dwm/wmii

Do you use xmonad? what are the advantages over other tiling wm. I do not know haskell, but I can definitely read any code. Maybe this is better discussed in another thread.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#23 2009-03-12 06:09:33

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: Dmen File Manager

When I try to open a txt file, it does not do anything, but when I click edit, it opens it up in my editor (geany). How can I also use the Open function to open files as well.

and to the mods: Could you make this a sticky?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#24 2009-03-12 11:14:52

ludovico
Member
From: Oslo, Norway
Registered: 2008-08-24
Posts: 75

Re: Dmen File Manager

Inxsible wrote:

Great work. I like it a lot. Just installed it and am using it in my dwm and wmii both.

The only issue is that i have to change the Default on bottom every time i switch WMs smile

But I am still weighing my options between dwm and wmii.

Have you tried changing the defaults directly in the script? Worked for me.


Sin? What's all this about sin?

Offline

#25 2009-04-08 13:20:50

skualito
Member
Registered: 2008-11-19
Posts: 186

Re: Dmen File Manager

Great script !

I would like the directories to appear with a "/" at the end , like the output of 'ls | dmenu'. How can I do that ?

Offline

Board footer

Powered by FluxBB