Initial commit

This commit is contained in:
Tim Schubert 2021-01-24 19:00:03 +01:00
commit 3393073cd3
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
9 changed files with 122 additions and 0 deletions

24
bin/archpad Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
url="$1"
pad=$(basename $url).txt
dst="$2"
gitdir="$(dirname $dst)"
wget -Q 10m -O "${dst}" "${url}/export/txt"
status="$?"
if [ ${status} -ne 0 ]; then
echo "Failed to get pad at ${url}"
return ${status}
else
git -C "${gitdir}" add "${dst}"
changes=$(git -C "${gitdir}" diff --cached | wc -l)
if [ $changes -gt 0 ]; then
git -C "${gitdir}" commit -m "Updated: ${dst} from ${url}"
else
echo "Nothing changed for ${url}"
fi
fi
git -C "${gitdir}" reset --hard HEAD

26
bin/colortest Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m\
44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \
'1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \
' 36m' '1;36m' ' 37m' '1;37m';
do FG=${FGs// /}
echo -en " $FGs \033[$FG $T "
for BG in 40m 41m 42m 43m 44m 45m 46m 47m;
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
done
echo;
done
echo

6
bin/lock-session Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.MainWindow.lockAllDatabases
swaymsg 'output * dpms off'
swaylock -c 1f2022
swaymsg 'output * dpms on'

3
bin/notify-failed Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
notify-send -u critical "$1" 'Unit failed' --icon=dialog-warning

3
bin/notify-finished Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
notify-send -u low "$1" 'Unit finished' --icon=dialog-information

3
bin/notify-starting Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
notify-send -u low "$1" 'Unit is starting' --icon=dialog-information

14
bin/share Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -u
set -e
name=$(basename $1)
user="dadada"
host="share.dadada.li"
w3dir="share"
pubname="$(sha256sum $1 | cut -d " " -f 1)"
ssh ${user}@${host} "mkdir -p ${w3dir}/${pubname}" > /dev/null
scp $1 ${user}@${host}:${w3dir}/${pubname}/${name} > /dev/null
echo "https://${host}/${pubname}/${name}"