summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/dropdowntoggle18
-rwxr-xr-x.local/bin/shortcutgen4
-rwxr-xr-x.local/bin/upsite27
3 files changed, 40 insertions, 9 deletions
diff --git a/.local/bin/dropdowntoggle b/.local/bin/dropdowntoggle
index f4a4705..91e834e 100755
--- a/.local/bin/dropdowntoggle
+++ b/.local/bin/dropdowntoggle
@@ -8,11 +8,23 @@
name="$1"
class="dropdown"
title="dropdown_$name"
-active="$(xdotool search --name $title | wc -l)"
+active="$(xdotool search --name "$title" | wc -l)"
shift
+case "$TERMINAL" in
+*st)
+ classflag="-c"
+ titleflag="-t"
+ cmdflag="-e"
+ ;;
+*alacritty)
+ classflag="--class"
+ titleflag="--title"
+ cmdflag="--command"
+ ;;
+esac
case "$active" in
- 0) $TERMINAL --class "dropdown" --title "$title" --command "$@" & ;;
- *) kill -9 `xdotool search --name "$class" getwindowpid` ;;
+0) $TERMINAL "$classflag" "dropdown" "$titleflag" "$title" "$cmdflag" "$@" & ;;
+*) kill -9 "$(xdotool search --name "$class" getwindowpid)" ;;
esac
diff --git a/.local/bin/shortcutgen b/.local/bin/shortcutgen
index ce29ffb..2335a92 100755
--- a/.local/bin/shortcutgen
+++ b/.local/bin/shortcutgen
@@ -16,5 +16,7 @@ echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/map g\2 cd \3/' >"$XDG_CONFIG_HOME/lf/
echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/alias g\2="cd \3"/' >"$HOME/.cache/zsh-shortcuts"
# Environment variables (read by .profile)
-echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/export G\U\2="\3"/' >"$HOME/.cache/env-shortcuts"
+echo "$raw" | sed 's/^\(.*\),\(.*\),/export G\U\2=,/;s/,\(.*\)/\1/' >"$HOME/.cache/env-shortcuts"
+
+
diff --git a/.local/bin/upsite b/.local/bin/upsite
index c6ef404..5b15d21 100755
--- a/.local/bin/upsite
+++ b/.local/bin/upsite
@@ -1,11 +1,28 @@
#!/bin/sh
-sitename="chausse.xyz"
+username="master"
+url="chausse.xyz"
+siteroot="$HOME/Workspace/$url"
-branch="construction"
-
-cd "$HOME/Workspace/$sitename$construction" && git pull origin $branch && git checkout $branch
+case "$1" in
+ -d|--dev)
+ url="dev.$url"
+ destdir="/var/www/dev"
+ branch="master"
+ ;;
+ -m|--main)
+ destdir="/var/www/chausse"
+ branch="construction"
+ ;;
+ *)
+ echo "Usage: upsite [dev|main]"
+ exit 1
+ ;;
+esac
+cd "$siteroot" || exit 1
+git checkout $branch
+git pull
hugo --gc=true --minify
+rsync -aucz --delete --progress "$siteroot/public/" "$username@$url:$destdir"
-rsync -auvz "$HOME/Workspace/$sitename$construction/public/" "master@$sitename:/var/www/chausse"