Sxiv: rename file name

Created on 14 Nov 2020  路  5Comments  路  Source: muennich/sxiv

Is there a way to rename images?

Most helpful comment

@pikin-cock It's better to use absolute path like this:

    "r")
        name="$(dmenu -p "rename $file to: ")" 2> /dev/null
        if ! [ -z "$name" ]; then
            #mv "$file" "$name"
            mv "$file" "$(dirname $file)/$name"
        fi
        ;;

All 5 comments

Not builtin, but you can use the keyhandler and possibly something like
zenity to create a dialog.

This in your keyhandler should do it

    "r")
            name="$(dmenu -p "rename $file to: ")" 2> /dev/null
            if ! [ -z "$name" ]; then
                mv "$file" "$name"
            fi
            ;;

@pikin-cock It's better to use absolute path like this:

    "r")
        name="$(dmenu -p "rename $file to: ")" 2> /dev/null
        if ! [ -z "$name" ]; then
            #mv "$file" "$name"
            mv "$file" "$(dirname $file)/$name"
        fi
        ;;

Oh I see, thanks!

exellent works like a charm ... thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anko picture anko  路  4Comments

Knusper picture Knusper  路  4Comments

astier picture astier  路  17Comments

MimaHakurei picture MimaHakurei  路  3Comments

rpdelaney picture rpdelaney  路  9Comments