Skip to content

Instantly share code, notes, and snippets.

@afrontend
Last active May 3, 2018 12:17
Show Gist options
  • Save afrontend/8e4fed4d155bf8ecd7a7679ffef012e8 to your computer and use it in GitHub Desktop.
Save afrontend/8e4fed4d155bf8ecd7a7679ffef012e8 to your computer and use it in GitHub Desktop.
nautilus-actions 설정 파일과 오늘 날짜로 디렉토리 만들어주는 쉘 스크립트, https://agvim.wordpress.com/2018/04/20/nautilus-context-menu/
[Desktop Entry]
Type=Action
Name[ko]=날짜 폴더
Tooltip[ko]=오늘 날짜 이름으로 폴더를 만든다
Icon[ko]=add
TargetContext=false
TargetLocation=true
ToolbarLabel[ko]=날짜 디렉토리
Profiles=profile-zero;
[X-Action-Profile profile-zero]
Name[ko]=Default profile
Exec=mkdirWithDateName.sh %D/%b
#!/usr/bin/env bash
#mkdirWithDateName.sh
function mkdirWithDateName() {
local today
today=$(date +"%m월%d일")
if [ -z "$1" ]; then
mkdir "${today}"
else
mkdir "$1/${today}"
fi
}
mkdirWithDateName $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment