summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkeyboard/dmenunametag17
-rwxr-xr-xsync/griff53
2 files changed, 63 insertions, 7 deletions
diff --git a/keyboard/dmenunametag b/keyboard/dmenunametag
index b4ea69e..828aca9 100755
--- a/keyboard/dmenunametag
+++ b/keyboard/dmenunametag
@@ -1,5 +1,6 @@
#!/bin/sh
numtags=9
+defnames="Code\nCompile\nTest\nDebug\nEdit"
while !([ $tagnum -ge 1 2>/dev/null ] && [ $tagnum -le $numtags ]); do
tagnum=$(seq $numtags | dmenu -p "Choose tag: ")
[ "$tagnum" = "" ] && exit
@@ -8,12 +9,14 @@ while [ "$action" != "Rename" ] && [ "$action" != "Remove" ]; do
action=$(echo -n "Rename\nRemove" | dmenu -p "Would you like to rename or remove this tag $tagnum's label? ")
[ "$action" = "" ] && exit
done
-if [ "$action" = "Rename" ]; then
- name="$(dmenu -p "Rename tag $tagnum to: " <&-)"
- [ "$name" = "" ] && exit
- nametag $tagnum n "$name"
-else
- nametag $tagnum r
-fi
+case $action in
+ Rename)
+ name="$(echo -n "$defnames" | dmenu -p "Rename tag $tagnum to: ")"
+ [ "$name" = "" ] && exit
+ nametag $tagnum n "$name"
+ ;;
+ Remove) nametag $tagnum r ;;
+ *) exit ;;
+esac
# Force bar to update by setting the root name to itself since there is currently a bug in the window manager
xsetroot -name "$(xprop -root WM_NAME | sed -n 's/^WM_NAME(STRING) = \"\(.*\)\"/\1/p')"
diff --git a/sync/griff b/sync/griff
new file mode 100755
index 0000000..02b4183
--- /dev/null
+++ b/sync/griff
@@ -0,0 +1,53 @@
+#!/bin/sh
+home=$(echo $HOME | sed 's/\//\\\//g')
+repos="$(grep -v '#' | sed "s/\~/$home/")" << REPOS
+blr|~/.local/src/programs/blr
+dmenu|~/.local/src/programs/dmenu
+dotconfig|~/.config
+scripts|~/.local/bin
+st|~/.local/src/programs/st
+timmywm|~/.local/src/programs/timmywm
+REPOS
+#echo "$repos" | cut -f1
+
+# Colors
+BOLD="\033[1m"
+NORM="\033[0m"
+CYN="\033[0;36m"
+RED="\033[0;31m"
+GRN="\033[0;32m"
+MAG="\033[0;35m"
+
+for repo in $repos; do
+ name=$(echo $repo | cut -d'|' -f1)
+ dir=$(echo $repo | cut -d'|' -f2)
+ if cd $dir 2>/dev/null; then
+ if git diff --quiet HEAD $REF -- $DIR; then
+ echo "$GRN[Repo $name is unchanged!]$NORM"
+ else
+ echo "$CYN[Repo $name has changed:]$NORM"
+ echo "\tFiles Changed:"
+ git diff HEAD $REF -- $DIR | sed -n '/^+++/ s/+++ b\//\t- /p'
+ echo
+ read -p "Would you like to view the changes? [y/n]: " viewchange
+ case $viewchange in
+ y|yes|Y|Yes) git diff HEAD $REF -- $DIR ;;
+ esac
+ read -p "Would you like to push these changes? [y/n]: " pushchange
+ case $pushchange in
+ y|yes|Y|Yes)
+ while [ -z "$commitmsg" ]; do
+ read -p "Enter a commit message: " commitmsg
+ done
+ git add .
+ git commit -m "$commitmsg" \
+ && echo "$GRN[Changes to repo $name successfully pushed!]$NORM" \
+ || echo "$RED[An error occured while pushing changes to repo $name!]$NORM"
+ git push
+ ;;
+ esac
+ fi
+ else
+ echo "$BOLD$RED[Repo $name does not exist at $dir!]$NORM"
+ fi
+done