Compare commits

...

3 Commits

Author SHA1 Message Date
2a14077225 Use age encryption. 2023-04-21 12:05:27 +02:00
d3d18bd893 Update pacman cache cleanup script 2023-03-23 21:19:51 +01:00
da2f609803 Add dk scratchpads script 2023-03-23 21:19:19 +01:00
3 changed files with 40 additions and 2 deletions

View File

@ -11,7 +11,8 @@ encrypt () {
x=$(date +%d.%m.%y) x=$(date +%d.%m.%y)
cd "$HOME/.local" cd "$HOME/.local"
tar cv -I"zstd -19 -T0" -f "$HOME/.local/cloud/backup-$x.tar.zst" "backup" tar cv -I"zstd -19 -T0" -f "$HOME/.local/cloud/backup-$x.tar.zst" "backup"
gpg -c --no-symkey-cache --cipher-algo AES256 -o "$HOME/.local/cloud/backup-$x.tar.zst.gpg" "$HOME/.local/cloud/backup-$x.tar.zst" read -p "Enter public key" pubKey
age -r $pubKey "$HOME/.local/cloud/backup-$x.tar.zst" > "$HOME/.local/cloud/backup-$x.tar.zst.age"
shred -uzn3 "$HOME/.local/cloud/backup-$x.tar.zst" shred -uzn3 "$HOME/.local/cloud/backup-$x.tar.zst"
} }

37
dk-scratch Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# basic scratchpad functionality for dk
# spawns a set command with a known title if not already open
# if open toggle between the current workspace and the last
# written by Nathaniel Maia - 2021
# example rule for the below script to be placed in your dkrc
# dkcmd rule class="^scratchpad$" float=true
# Dinamically get both class and command of the needed scratchpad
title="$1"
shift
cmd="$@"
# window ID, we need to printf it as 8 hex digits to later match with dk status
win=$(printf '0x%08x' "$(xwininfo -root -children | awk '/'"$title"'/ {print $1}')")
stat=$(dkcmd status num=1 type=full)
if (( win != 0 )); then
# window is already open so toggle it
ws=$(awk '/^workspaces:/ { for (i = 1; i <= NF; i++) { if ($i ~ "*") print i - 1 } }' <<< "$stat")
wins=$(sed -n '/^windows:/,/^$/p' <<< "$stat")
win_ws=$(grep "^\s*${win}" <<< "$wins" | awk -F'" ' '{print $4}' | cut -d' ' -f1)
if (( win_ws == ws )); then
# hide it
# we could create a new workspace and place it there instead to not mess with the users existing workspaces
dkcmd ws send "$win" "$(awk '/numws/{print $2}' <<< "$stat")"
else
# show it
dkcmd ws send "$win" "$ws"
fi
else
# the window is not yet spawned so do so
${cmd} &>/dev/null & disown
fi

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
/usr/bin/paccache -ruk1 /usr/bin/paccache -ruk0
/usr/bin/paccache -rk2 /usr/bin/paccache -rk2