Here's the main script that does most of the stuff:
#!/bin/bash pushd darkrc git pull popd at 11:55 <<'BASH' 2>/dev/null DISPLAY=:0 notify-send 'Pause in 5 minuten' BASH at 12:00 <<'BASH' 2>/dev/null playerctl pause aplay gong.wav & DISPLAY=:0 zenity --warning --text 'Es ist 12:00' --title 'Pause!' --width=300 --height=100 BASH if [ $(date +%w) -lt 5 ]; then h_end=16 else h_end=14 fi at $h_end:20 <<'BASH' 2>/dev/null export DISPLAY=:0 notify-send 'Feierabend in 10 minuten' GIT_ASKPASS=askpass git-push-pending $HOME/workspace & disown BASH at $h_end:30 <<'BASH' 2>/dev/null DISPLAY=:0 zenity --warning --text 'Feierabend! JETZT! 🍻' --title 'Feierabend!' --width=300 --height=100 BASH farfetched ~/workspace echo ─────────────────────────────────── fortune echo ───────────────────────────────────
Most of the output is in German, but otherwise it should be fairly easy to follow.
The git-push-pending script is a bit more complex:
git-push-pending
#!/bin/sh (for name in $@; do find -L $name -name '*.git' -type d | sed 's/\/.git$//'; done) \ | xargs git-pending \ | grep '^ahead' \ | lua -e 'for line in io.lines() do print(line:match("[^/]+$")); print((line:gsub("^[^ ]* ", ""))) end' \ | zenity --list --column Repository --column Path --text "Repositories that need pushing:" --multiple --title "Git" --separator ';' --width 800 --height 300 --print-column=2 2>/dev/null \ | tr ';' '\n' \ | xargs -L 1 -I€ sh -c 'cd € && git push'
and it makes use of the git-pending script which looks like this:
git-pending
#!/bin/sh for line in $@ do dir=$(pwd) cd "$line" if git log -0 2>/dev/null then stat=$(git branch -vv | grep -P '^\*' | grep -Po '\[.*\]') if echo $stat | grep -P 'behind' > /dev/null then echo behind $line fi if echo $stat | grep -P 'ahead' > /dev/null then echo ahead $line fi fi cd $dir done
Awesome, ssst. but I'm posting my GIT status script tomorrow, all build in bash to tell you what your git statusses are.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's the main script that does most of the stuff:
Most of the output is in German, but otherwise it should be fairly easy to follow.
The
git-push-pending
script is a bit more complex:and it makes use of the
git-pending
script which looks like this:Awesome, ssst. but I'm posting my GIT status script tomorrow, all build in bash to tell you what your git statusses are.