From ee60d3cb6496d9e6ae81f93c55098da4dff23469 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Mon, 27 May 2019 13:57:21 +0200 Subject: [PATCH] Change directories to lower case Signed-off-by: Severin Kaderli --- install | 38 ++++++++++++++++++-------------- post-install | 10 +++++++-- system/.config/cron/crontab | 2 +- system/.config/custom/aliases | 12 ++++------ system/.config/gtk-3.0/bookmarks | 10 ++++----- system/.config/user-dirs.dirs | 10 ++++----- system/.local/bin/screenshot | 2 +- system/.local/bin/sync-notes | 6 ++++- system/.local/bin/sync-tasks | 10 ++++++--- 9 files changed, 57 insertions(+), 43 deletions(-) diff --git a/install b/install index e990554..6da98a0 100755 --- a/install +++ b/install @@ -24,18 +24,22 @@ HOST="$(hostname)" # Directories which should be created DIRECTORIES=( ".local/log" - "Build" - "Downloads" + "build" + "documents" + "downloads" ".local/keys" - "Music" - "Pictures" - "Projects" - "Tasks" - "Videos" + "music" + "pictures" + "projects" + "tasks" + "videos" ) WORK_DIRECTORIES=( - "Work" + "work" + ".local/log" + "downloads" + ".local/keys" ) # Files which should be symlinked in the home folder @@ -83,8 +87,8 @@ LINKED_FILES_HOME=( # Symlinks which will be created declare -A LINKED_FILES LINKED_FILES=( - ["${HOME}/Music"]="${HOME}/Documents/Media/Music" - ["${HOME}/Pictures"]="${HOME}/Documents/Media/Pictures" + ["${HOME}/music"]="${HOME}/documents/Media/Music" + ["${HOME}/pictures"]="${HOME}/documents/Media/Pictures" ) # Permissions to set for folders and files @@ -106,7 +110,6 @@ SYSTEMD_SERVICES=( "NetworkManager" "org.cups.cupsd" "suspend" - "sxhkd" "xboxdrv" ) @@ -142,19 +145,20 @@ yay -S --noconfirm --needed "$(cat "${PACKAGES_DIR}/packages.list")" # Creating directories # ############################################################################### print_section "Creating directories" -for dir in "${DIRECTORIES[@]}" -do - print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}" - mkdir -p "${HOME}/${dir}" -done + if [ "${IS_WORK}" = "1" ]; then - print_section "Creating work directories" for dir in "${WORK_DIRECTORIES[@]}" do print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}" mkdir -p "${HOME}/${dir}" done +else + for dir in "${DIRECTORIES[@]}" + do + print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}" + mkdir -p "${HOME}/${dir}" + done fi diff --git a/post-install b/post-install index fe9549b..a10d02f 100755 --- a/post-install +++ b/post-install @@ -36,9 +36,15 @@ RUST_COMPONENTS=( # Main code ####################################### print_section "Setup notes directory" -if [ ! -d "${HOME}/Notes" ] +if [ ! -d "${HOME}/notes" ] then - git clone gl:notes "${HOME}/Notes" + git clone gl:notes "${HOME}/notes" +fi + +print_section "Setup tasks directory" +if [ ! -d "${HOME}/tasks" ] +then + git clone gl:tasks "${HOME}/tasks" fi print_section "Installing global npm packages" diff --git a/system/.config/cron/crontab b/system/.config/cron/crontab index fc7e83b..c0458c0 100644 --- a/system/.config/cron/crontab +++ b/system/.config/cron/crontab @@ -11,7 +11,7 @@ # This file is loaded on boot by crontab. # Synchronize Google Drive every 15 minutes -*/15 * * * * grive -d -p $HOME/Documents/ >> $HOME/.local/log/cron.log +*/15 * * * * grive -d -p $HOME/documents/ >> $HOME/.local/log/cron.log # Sync pacman databases every 15 minutes */15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log diff --git a/system/.config/custom/aliases b/system/.config/custom/aliases index 5160be3..5591047 100644 --- a/system/.config/custom/aliases +++ b/system/.config/custom/aliases @@ -26,14 +26,10 @@ alias grep="rg -n" # Alias for using bat as cat replacement alias cat="bat" -# Alias to get to my Projects folder -alias pj="cd ~/Projects" - -# Alias to get to my Downloads folder -alias dl="cd ~/Downloads" - -# Alias to get to my Documents folder -alias doc="cd ~/Documents" +# Aliases to folders +alias pj="cd ~/projects" +alias dl="cd ~/downloads" +alias doc="cd ~/documents" # Alias for opening my code editor alias e="code" diff --git a/system/.config/gtk-3.0/bookmarks b/system/.config/gtk-3.0/bookmarks index 1f43bae..54a5a4b 100644 --- a/system/.config/gtk-3.0/bookmarks +++ b/system/.config/gtk-3.0/bookmarks @@ -1,6 +1,6 @@ -file:///home/severin/Documents Documents -file:///home/severin/Downloads Downloads -file:///home/severin/Videos Videos -file:///home/severin/Projects Projects +file:///home/severin/documents Documents +file:///home/severin/downloads Downloads +file:///home/severin/videos Videos +file:///home/severin/projects Projects file:///home/severin/dotfiles dotfiles -file:///home/severin/Notes Notes +file:///home/severin/notes Notes diff --git a/system/.config/user-dirs.dirs b/system/.config/user-dirs.dirs index 80bbae2..c297807 100644 --- a/system/.config/user-dirs.dirs +++ b/system/.config/user-dirs.dirs @@ -5,11 +5,11 @@ # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_DOWNLOAD_DIR="$HOME/Downloads" -XDG_MUSIC_DIR="$HOME/Music" -XDG_PICTURES_DIR="$HOME/Pictures" -XDG_VIDEOS_DIR="$HOME/Videos" +XDG_DOCUMENTS_DIR="$HOME/documents" +XDG_DOWNLOAD_DIR="$HOME/downloads" +XDG_MUSIC_DIR="$HOME/music" +XDG_PICTURES_DIR="$HOME/pictures" +XDG_VIDEOS_DIR="$HOME/videos" XDG_DESKTOP_DIR="$HOME" XDG_TEMPLATES_DIR="$HOME" XDG_PUBLICSHARE_DIR="$HOME" diff --git a/system/.local/bin/screenshot b/system/.local/bin/screenshot index 4503b70..ce2a6fa 100755 --- a/system/.local/bin/screenshot +++ b/system/.local/bin/screenshot @@ -23,7 +23,7 @@ ACTIONS=( "4: Selection (Clipboard)" ) -FILENAME="${HOME}/Pictures/Screenshots/%Y-%m-%d-%H%M%S.png" +FILENAME="${HOME}/pictures/Screenshots/%Y-%m-%d-%H%M%S.png" SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -p "${PROMPT}" | cut -d ":" -f1) case "${SELECTION}" in diff --git a/system/.local/bin/sync-notes b/system/.local/bin/sync-notes index 2b987fe..604b60d 100755 --- a/system/.local/bin/sync-notes +++ b/system/.local/bin/sync-notes @@ -13,9 +13,13 @@ # ./sync-notes . /home/severin/.local/bin/utils +if [ ! -d "/home/severin/notes" ]; then + exit +fi + print_time_log "sync-notes" "Synchronizing notes" -cd "/home/severin/Notes" || exit +cd "/home/severin/notes" || exit git pull > /dev/null 2>&1 git add --all > /dev/null 2>&1 git commit -s -m "Update notes" > /dev/null 2>&1 diff --git a/system/.local/bin/sync-tasks b/system/.local/bin/sync-tasks index d20a874..1853b00 100755 --- a/system/.local/bin/sync-tasks +++ b/system/.local/bin/sync-tasks @@ -13,14 +13,18 @@ # ./sync-tasks . /home/severin/.local/bin/utils -export TASKDATA="/home/severin/Tasks" -export TASKRC="/home/severin/.config/task/taskrc" +if [ ! -d "/home/severin/tasks" ]; then + exit +fi print_time_log "sync-tasks" "Synchronizing tasks" +export TASKDATA="/home/severin/tasks" +export TASKRC="/home/severin/.config/task/taskrc" + task sync -cd "/home/severin/Tasks" || exit +cd "/home/severin/tasks" || exit git pull > /dev/null 2>&1 git add --all > /dev/null 2>&1 git commit -s -m "Update tasks" > /dev/null 2>&1