Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
huijunchen9260 committed Dec 27, 2019
1 parent c080399 commit 59e3fec
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ A simple dmenu file manager written in POSIX-compliant shell script.
- File management (*yank, move, symbolic link, **ranger style bulk rename**, etc*)
- Remember you last path ([CD on Exit](#cd-on-exit))
- Rolling menu for dynamic file browsing ([Rolling Menu](#rolling-menu))
- Able to **Preview** you file. (use [`EYE` to preview your file](#eye-to-preview-your-file))


[![Distrotube introduced my project much better than I would](https://img.youtube.com/vi/EyW6pRlWv6Q/0.jpg)](https://www.youtube.com/watch?v=EyW6pRlWv6Q)

Expand Down Expand Up @@ -120,20 +122,20 @@ OPTS: -h | --help - Show this usage information.

Use `-p | --lastpath` option:

```
```sh
dmenufm -p
```

### Rolling Menu

Use `-r` option for rolling menu based on the file that you opened:

```
```sh
dmenufm -r
```

For example, the original list is
```
```sh
../
./
Actions
Expand All @@ -145,7 +147,7 @@ file4
```

You open `file3`. After you close `file3`, the menu would be
```
```sh
../
./
Actions
Expand Down Expand Up @@ -197,7 +199,7 @@ Delete directories or files.

#### `TRH` to put in trash.

- `$HOME/.config/dmenufm/trash` is the directory storing trashes for dmenufm.
- `$HOME/.cache/dmenufm/trash` is the directory storing trashes for dmenufm.
- `Move file to trash` will generate a new dmenu prompt.
- Choose any file to move to trash.
- To move a directory to trash, enter the directory, and choose `./` to confirm this directory..
Expand Down Expand Up @@ -279,15 +281,18 @@ There are many environment variables you can use to configure dmenufm by exporti

The default options are as follows:

```
```sh
# FILES LOCATION
export FM_PATH="$HOME/.config/dmenufm"
export FM_TRASH="$FM_PATH/trash"
export FM_CACHE_PATH="$HOME/.cache/dmenufm"
export FM_BMKFILE="$FM_PATH/dmenufm_bookmark"
export FM_CMDFILE="$FM_PATH/dmenufm_command"
export FM_HISFILE="$FM_PATH/dmenufm_history"
export FM_LASTPATH="$FM_PATH/dmenufm_lastpath"
export FM_REMFILE="$FM_PATH/dmenufm_bulk_rename"
export FM_SDOPROP="$FM_PATH/dmenufm_sudoprompt"
export FM_LASTPATH="$FM_CACHE_PATH/dmenufm_lastpath"
export FM_REMFILE="$FM_CACHE_PATH/dmenufm_bulk_rename"
export FM_ZIPATH="$FM_CACHE_PATH/compression/"
export FM_TRASH="$FM_CACHE_PATH/trash"
# Max number for history
export FM_MAX_HIS_LENGTH=5000
# FONTS
Expand Down Expand Up @@ -380,6 +385,7 @@ export FM_GENERIC_COLOR="#005577"
export FM_ACTION_COLOR_LV1="#33691e"
export FM_ACTION_COLOR_LV2="#FF8C00"
export FM_ACTION_COLOR_BULK="#CB06CB"
export FM_SUDO_COLOR="red"
```

Change the font / font size / color in the `""` to customize the appearance of dmenufm.
Expand Down
4 changes: 2 additions & 2 deletions dmenufm
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# FILES LOCATION
FM_PATH="${FM_PATH:-$HOME/.config/dmenufm}"
FM_CACHE_PATH="${FM_CACHE_PATH:-$HOME/.cache/dmenufm}"
FM_TRASH="${FM_TRASH:-$FM_CACHE_PATH/trash}"
FM_BMKFILE="${FM_BMKFILE:-$FM_PATH/dmenufm_bookmark}"
FM_CMDFILE="${FM_CMDFILE:-$FM_PATH/dmenufm_command}"
FM_HISFILE="${FM_HISFILE:-$FM_PATH/dmenufm_history}"
FM_SDOPROP="${FM_SDOPROP:-$FM_PATH/dmenufm_sudoprompt}"
FM_TRASH="${FM_TRASH:-$FM_CACHE_PATH/trash}"
FM_LASTPATH="${FM_LASTPATH:-$FM_CACHE_PATH/dmenufm_lastpath}"
FM_REMFILE="${FM_REMFILE:-$FM_CACHE_PATH/dmenufm_bulk_rename}"
FM_ZIPATH="${FM_ZIPATH:-$FM_CACHE_PATH/compression/}"
Expand Down Expand Up @@ -82,7 +82,7 @@ CheckDeps () {
unset CurDep
}

CheckDeps find tail xdg-mime xdg-open sed grep wc cp mv rm paste cut id wmctrl
CheckDeps find tail xdg-mime xdg-open sed grep wc cp mv rm paste cut id wmctrl xclip

UsageInfo () {
while read -r CurLine; do
Expand Down
10 changes: 6 additions & 4 deletions dmenufm-action
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ FM_NEW () { # Usage: FM_NEW
FM_PCP () { # Usage: FM_PCP
# Copy path to xclip, and send notification.
ActionMenu "Copy file / directory path: " "$FM_ACTION_COLOR_LV1" || return
if [ -n "$HERE" ] && CheckDeps xclip; then
if [ -n "$HERE" ] && command -v xclip; then
printf '%s' "$HERE" | xclip -selection clipboard && NotiPrompt "Path $name copied to clipboard."
elif [ -n "$HERE" ] && CheckDeps xsel; then
elif [ -n "$HERE" ] && command -v xsel; then
printf '%s' "$HERE" | xsel --clipboard && NotiPrompt "Path $name copied to clipboard."
elif [ -n "$HERE" ]; then
NotiPrompt "Need to install xclip or xsel as dependency"
Expand Down Expand Up @@ -438,18 +438,20 @@ FM_SDO () {

FM_EYE () {
preview="true"

yprompt () { # Usage yprompt [MSG] [BG_COLOR]
dmenu -f -fn "$FM_GENERIC_FONT" -b -i -h 40 -sb "$2" -p "$1"
}
HERE="placeholder"

ActionMenu "Preview mode: " "$FM_ACTION_COLOR_LV1" || return && allowbulk="NotAllowed"
[ -n "$HERE" ] && FileOpen "$HERE" &
while [ -n "$HERE" ]; do
[ -n "$HERE" ] && wmctrl -c :ACTIVE: &
ActionMenu "Preview mode: " "$FM_ACTION_COLOR_LV1" || return && allowbulk="NotAllowed"
[ -n "$HERE" ] && FileOpen "$HERE" &
[ -n "$HERE" ] && wmctrl -c :ACTIVE: &
done
wmctrl -c :ACTIVE:

yprompt () { # Usage yprompt [MSG] [BG_COLOR]
dmenu -f -fn "$FM_GENERIC_FONT" -i -sb "$2" -l 10 -p "$1"
}
Expand Down

0 comments on commit 59e3fec

Please sign in to comment.