Compare commits

...

5 Commits

Author SHA1 Message Date
a35ea02b40 add swap 2021-11-29 19:13:00 +01:00
01b63ecd5f add switchkb 2021-11-21 10:35:12 +01:00
637857a6fe add twtxt client 2021-10-10 00:25:02 +02:00
e9ff6c7efc [pams] improve installation 2021-08-17 16:02:53 +02:00
b1117f3578 add h 2021-07-17 14:58:41 +02:00
6 changed files with 69 additions and 10 deletions

10
h Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# h - display help page for program
# based on https://hg.sr.ht/~sietsebb/dotfiles/browse/bin/h?rev=tip
man $1 ||
$1 --help 2>&1 | less ||
$1 -h 2>&1 | less ||
echo "no help page for $1"

View File

25
pams
View File

@ -24,6 +24,17 @@ err_add_args() {
exit 1
}
audit() {
less "$aur"/"$1"/PKGBUILD
}
download() {
mkdir "$aur" 2>/dev/null
cd "$aur" || exit
echo downloading "$1"
git clone https://aur.archlinux.org/"$1".git 2>/dev/null
audit "$1"
}
# main program
@ -42,29 +53,23 @@ else
-a) if [ $# -ne 2 ]; then
err_add_args
else
less "$aur"/"$2"/PKGBUILD
audit "$2"
fi
;;
-d) if [ $# -ne 2 ]; then
err_add_args
else
originaldir="$(pwd)"
mkdir "$aur" 2>/dev/null
cd "$aur" || exit
git clone https://aur.archlinux.org/"$2".git
less "$aur"/"$2"/PKGBUILD
cd "$originaldir" || exit
download "$2"
fi
;;
-i) if [ $# -ne 2 ]; then
err_add_args
else
originaldir="$(pwd)"
cd "$aur"/"$2" || exit
cd "$aur"/"$2" 2>/dev/null || (echo "package not downloaded" && download "$2")
cd "$aur"/"$2"
makepkg -si
cd "$originaldir" || exit
fi
;;

7
swap Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
tmp=$(mktemp)
mv "$1" "$tmp"
mv "$2" "$1"
mv "$tmp" "$2"

14
switchkb Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
currentkb() {
setxkbmap -query | grep layout | awk '{print $2}'
}
if currentkb | grep "^nous$"; then
setxkbmap ru
#elif currentkb | grep "^ru$"; then
# apl keyboard
# setxkbmap us,apl -variant ,dyalog -option grp:switch
else
setxkbmap nous
fi

23
twt Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
PORT=420
USER=erik
SERVER=fixedpoints.zapto.org
usage() {
>&2 echo "usage: twt post \"your post\"
twt show"
}
remote() {
ssh -p $PORT $USER@$SERVER $1
}
case $1 in
post) remote "echo -e '`date -Im`\t$2' >> ~/twtxt.txt"
;;
show) remote "cat ~/twtxt.txt"
;;
*) usage
;;
esac