Compare commits
3 Commits
868fbb687b
...
2a14077225
Author | SHA1 | Date | |
---|---|---|---|
2a14077225 | |||
d3d18bd893 | |||
da2f609803 |
3
backuper
3
backuper
@ -11,7 +11,8 @@ encrypt () {
|
||||
x=$(date +%d.%m.%y)
|
||||
cd "$HOME/.local"
|
||||
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"
|
||||
}
|
||||
|
||||
|
37
dk-scratch
Executable file
37
dk-scratch
Executable 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
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/bin/paccache -ruk1
|
||||
/usr/bin/paccache -ruk0
|
||||
/usr/bin/paccache -rk2
|
||||
|
Loading…
Reference in New Issue
Block a user