From 902a9187e54dde03503d55db518eb6afd64011b6 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 21 Dec 2018 17:38:50 +0100 Subject: [PATCH] add .bin and .screenlayout --- .bin/daily.sh | 55 ++++++++++++++++++++++++++ .bin/notify.sh | 3 ++ .bin/screenlayout.sh | 3 ++ .bin/screenlock.sh | 20 ++++++++++ .bin/weechat | 5 +++ .screenlayout/000-internal-only.sh | 5 +++ .screenlayout/1080p-clone.sh | 2 + .screenlayout/1080p-left-of-laptop.sh | 2 + .screenlayout/1080p-right-of-laptop.sh | 2 + .screenlayout/docked.sh | 9 +++++ 10 files changed, 106 insertions(+) create mode 100755 .bin/daily.sh create mode 100755 .bin/notify.sh create mode 100755 .bin/screenlayout.sh create mode 100755 .bin/screenlock.sh create mode 100755 .bin/weechat create mode 100755 .screenlayout/000-internal-only.sh create mode 100755 .screenlayout/1080p-clone.sh create mode 100755 .screenlayout/1080p-left-of-laptop.sh create mode 100755 .screenlayout/1080p-right-of-laptop.sh create mode 100755 .screenlayout/docked.sh diff --git a/.bin/daily.sh b/.bin/daily.sh new file mode 100755 index 0000000..23d674d --- /dev/null +++ b/.bin/daily.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +export BORG_REPO=ssh://nas/media/backups/franzi +export BORG_PASSCOMMAND='pass show nas/backup-pass' + +info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; } +trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM + +yay -Syu +pass git push + +info "Starting backup" + +borg create \ + --verbose \ + --filter AME \ + --list \ + --stats \ + --show-rc \ + --compression lz4 \ + --exclude-caches \ + --exclude '/home/*/.cache/*' \ + --exclude '/home/*/.dbus' \ + \ + ::'{hostname}-{now}' \ + /home/kunsi \ + +backup_exit=$? + +info "Pruning repository" + +borg prune \ + --list \ + --prefix '{hostname}-' \ + --show-rc \ + --keep-daily 7 \ + --keep-weekly 4 \ + --keep-monthly 6 \ + +prune_exit=$? + +global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit )) + +if [ ${global_exit} -eq 1 ]; +then + info "Backup and/or Prune finished with a warning" +fi + +if [ ${global_exit} -gt 1 ]; +then + info "Backup and/or Prune finished with an error" +fi + +exit ${global_exit} + diff --git a/.bin/notify.sh b/.bin/notify.sh new file mode 100755 index 0000000..3e2d48c --- /dev/null +++ b/.bin/notify.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo 'meowww?' | osd_cat --pos middle --align center --delay 9 -O 15 -f '-*-dejavu sans-*-*-*-*-120-200-*-*-*-*-*-*' diff --git a/.bin/screenlayout.sh b/.bin/screenlayout.sh new file mode 100755 index 0000000..83e5cb2 --- /dev/null +++ b/.bin/screenlayout.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +ls ~/.screenlayout | grep -v "^_" | sed "s/\.sh$//" | dmenu | sed "s|^.*$|/home/kunsi/.screenlayout/&.sh|" | xargs sh diff --git a/.bin/screenlock.sh b/.bin/screenlock.sh new file mode 100755 index 0000000..91c797d --- /dev/null +++ b/.bin/screenlock.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +xset s noblank +xset s 90 10 + +pactl set-sink-mute alsa_output.pci-0000_00_1f.3.analog-stereo 1 +pactl set-source-mute alsa_input.pci-0000_00_1f.3.analog-stereo 1 + +#i3lock -e -t -i /home/kunsi/Pictures/laptop_unbenutzbar.png +#i3lock -e -t -i /home/kunsi/Pictures/lockscreen-lenowo.png +slock + + + +#MOVIE="/home/kunsi/Movies/pause-langsamer.mp4" +# +#ffplay -fs -loop 0 $MOVIE & +#PID=$(ps u | grep ffplay | grep $MOVIE | awk '{print $2}') +# +#alock -bg none && kill $PID diff --git a/.bin/weechat b/.bin/weechat new file mode 100755 index 0000000..b680828 --- /dev/null +++ b/.bin/weechat @@ -0,0 +1,5 @@ +#!/bin/sh + +#ssh kaito -t "tmux attach-session -t weechat" + +mosh --server="LANG=en_US.UTF-8 mosh-server" kaito -- tmux attach-session -d -t weechat diff --git a/.screenlayout/000-internal-only.sh b/.screenlayout/000-internal-only.sh new file mode 100755 index 0000000..8679ba4 --- /dev/null +++ b/.screenlayout/000-internal-only.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --off --output DP2-1 --off --output DP2-2 --off + +sudo rfkill unblock wifi diff --git a/.screenlayout/1080p-clone.sh b/.screenlayout/1080p-clone.sh new file mode 100755 index 0000000..53adaca --- /dev/null +++ b/.screenlayout/1080p-clone.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output HDMI2 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output DP2 --off diff --git a/.screenlayout/1080p-left-of-laptop.sh b/.screenlayout/1080p-left-of-laptop.sh new file mode 100755 index 0000000..7b61d52 --- /dev/null +++ b/.screenlayout/1080p-left-of-laptop.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output DP1 --off --output HDMI2 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output DP2 --off diff --git a/.screenlayout/1080p-right-of-laptop.sh b/.screenlayout/1080p-right-of-laptop.sh new file mode 100755 index 0000000..ab868fe --- /dev/null +++ b/.screenlayout/1080p-right-of-laptop.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output DP1 --off --output HDMI2 --mode 1920x1080 --pos 3840x0 --rotate normal --output HDMI1 --off --output DP2 --off diff --git a/.screenlayout/docked.sh b/.screenlayout/docked.sh new file mode 100755 index 0000000..ec37bd5 --- /dev/null +++ b/.screenlayout/docked.sh @@ -0,0 +1,9 @@ +#!/bin/sh +xrandr --output DP2-1 --mode 1920x1080 --pos 1920x0 --rotate normal +xrandr --output DP2-2 --primary --mode 1920x1080 --pos 0x0 --rotate normal + +xrandr --output eDP1 --off + +xset s off + +sudo rfkill block wifi