Add home directory support to dotfiles.sh get
This commit is contained in:
@@ -131,6 +131,7 @@ bindsym $mod+Shift+0 move container to workspace 10
|
|||||||
|
|
||||||
assign [class="Firefox"] $workspace1
|
assign [class="Firefox"] $workspace1
|
||||||
assign [class="Chromium"] $workspace1
|
assign [class="Chromium"] $workspace1
|
||||||
|
assign [class="Gedit"] $workspace2
|
||||||
assign [class="URxvt"] $workspace3
|
assign [class="URxvt"] $workspace3
|
||||||
assign [class="Thunar"] $workspace4
|
assign [class="Thunar"] $workspace4
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -40,8 +40,17 @@ elif [ "$1" == "list" ]; then
|
|||||||
|
|
||||||
elif [ "$1" == "get" ] && [ "$2" != "" ]; then
|
elif [ "$1" == "get" ] && [ "$2" != "" ]; then
|
||||||
FILE=$(readlink -f $2)
|
FILE=$(readlink -f $2)
|
||||||
mkdir -p $(pwd)/$(dirname $FILE)
|
FILE_CUT_HOME="$(echo $FILE | sed -nr 's/^\/home\/'$USER'\/(.*)$/\1/p')"
|
||||||
cp $FILE $(pwd)/$FILE
|
|
||||||
|
# /home/<user>/
|
||||||
|
if [ -n "$FILE_CUT_HOME" ]; then
|
||||||
|
mkdir -p $(pwd)/$(dirname $FILE_CUT_HOME)
|
||||||
|
cp $FILE $(pwd)/$FILE_CUT_HOME
|
||||||
|
# /
|
||||||
|
else
|
||||||
|
mkdir -p $(pwd)/$(dirname $FILE)
|
||||||
|
cp $FILE $(pwd)/$FILE
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ "$1" == "pull" ] || [ "$1" == "push" ]; then
|
elif [ "$1" == "pull" ] || [ "$1" == "push" ]; then
|
||||||
for f in $FILES; do
|
for f in $FILES; do
|
||||||
|
|||||||
Reference in New Issue
Block a user