Skip to content

Instantly share code, notes, and snippets.

@fpersson
Created September 14, 2016 12:43
Show Gist options
  • Save fpersson/bd224ec40e509cc8d66da15538dba1b7 to your computer and use it in GitHub Desktop.
Save fpersson/bd224ec40e509cc8d66da15538dba1b7 to your computer and use it in GitHub Desktop.

Revisions

  1. fpersson created this gist Sep 14, 2016.
    17 changes: 17 additions & 0 deletions addDate.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash
    #put in $HOME/bin/

    OIFS=$IFS
    NOW=$(date +"%y%m%d")
    IFS='.' read -r -a array <<< $1

    for result in "${array[@]}"; do
    echo $result
    done

    echo ${array[0]}
    echo ${array[1]}

    mv $1 ${array[0]}_$NOW.${array[1]}

    IFS=$OIFS
    14 changes: 14 additions & 0 deletions miscfiles.desktop
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #put in ~.local/share/kservices5/ServiceMenus/
    [Desktop Entry]
    Type=Service
    # all files inherit from application/octet-stream
    MimeType=application/octet-stream;
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin
    X-KDE-Submenu=MiscFiles
    Actions=addDate

    [Desktop Action addDate]
    Name=Add Date
    Name[sv]=Add Date
    Icon=utilities-terminal
    Exec=$HOME/bin/addDate.sh %f