Compare commits

..

No commits in common. "829052147b56e9f84860442cd36ce7158d77e5f8" and "771d23fe76122647b75736e5f4fa2cf22b1cf7ba" have entirely different histories.

6 changed files with 22 additions and 44 deletions

View File

@ -1,19 +1,21 @@
#!/bin/env bash #!/bin/env bash
copy () { copy () {
while read -r Line; do while read Line; do
echo "Syncing $(basename "$Line")" echo "Syncing $(basename $Line)"
rsync -ahAX -v --delete "$Line" "$HOME"/.local/backup rsync -ahAX -v --delete "$Line" $HOME/.local/backup
done <<< "$(cat "$HOME"/.config/rsync/sync-list)" done <<< "$(cat $HOME/.config/rsync/sync-list)"
} }
encrypt () { encrypt () {
x=$(date +%d.%m.%y) x=$(date +%d.%m.%y)
cd "$HOME/.local" || exit 1 cd "$HOME/.local"
[ ! -d "$HOME/.local/cloud" ] || mkdir -p "$HOME/.local/cloud" tar cv -I"zstd -19 -T0" -f "$HOME/.local/cloud/backup-$x.tar.zst" "backup"
tar cv -I"zstd -19 -T0" "backup" | age -r "age1chj26ez7ucr2smkr8sfc9ddaa0fcyfljh5f5uk5kuyd8ctahs9wslfs708" > "$HOME/.local/cloud/backup-$x.tar.zst.age" 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"
} }
[ -z "$*" ] && exit 1 [ -z "$@" ] && exit 1
[ "$1" = "copy" ] && copy && exit 0 [ "$1" = "copy" ] && copy
[ "$1" = "encrypt" ] && encrypt && exit 0 [ "$1" = "encrypt" ] && encrypt

View File

@ -37,19 +37,19 @@ x11_on () {
xrandr --output eDP --set TearFree off xrandr --output eDP --set TearFree off
} }
if [ -f "$HOME"/.cache/gaming.lock ]; then if [ -f $HOME/.cache/gaming.lock ]; then
[ "$XDG_SESSION_TYPE" = "wayland" ] && wayland_off || x11_off [ $XDG_SESSION_TYPE = "wayland" ] && wayland_off || x11_off
start-program transmission-daemon start-program transmission-daemon
start-program syncthing start-program syncthing
nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=2' nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=2'
rm "$HOME"/.cache/gaming.lock rm $HOME/.cache/gaming.lock
quick-notify "Gaming Time" "OFF" quick-notify "Gaming Time" "OFF"
else else
[ "$XDG_SESSION_TYPE" = "wayland" ] && wayland_on || x11_on [ $XDG_SESSION_TYPE = "wayland" ] && wayland_on || x11_on
transmission-remote --exit transmission-remote --exit
syncthing cli operations shutdown syncthing cli operations shutdown
kill-nicely ferdium kill-nicely ferdium
nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=1' nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=1'
touch "$HOME"/.cache/gaming.lock touch $HOME/.cache/gaming.lock
quick-notify "Gaming Time" "ON" quick-notify "Gaming Time" "ON"
fi fi

View File

@ -2,8 +2,8 @@
# Because of my regular non american laptop onboard keyboard layout and american externals one this is my hack to use both for dedicated device. # Because of my regular non american laptop onboard keyboard layout and american externals one this is my hack to use both for dedicated device.
ids=$(xinput | grep 'AT Translated Set 2 keyboard' | cut -d '=' -f 2 | awk '{ print $1 }') ids=$(xinput | grep "SEMICO USB Keyboard" | grep "keyboard" | cut -d '=' -f 2 | cut -f 1)
for id in $ids; do for id in $ids; do
setxkbmap -device "$id" -layout hr -option caps:escape setxkbmap -device $id -layout us -option caps:escape
done done

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
id=$(xinput list --id-only 'pointer:Logitech G305') id=$(xinput list --id-only 'MOSART Semi. 2.4G INPUT DEVICE Mouse')
xinput --set-prop "$id" 'libinput Accel Speed' 0 xinput --set-prop $id 'libinput Accel Speed' -0.5
xinput --set-prop "$id" 'libinput Accel Profile Enabled' 0, 1 xinput --set-prop $id 'libinput Accel Profile Enabled' 0, 1

View File

@ -1,15 +0,0 @@
#!/bin/sh
profiles=$(find "$HOME"/.config/mblaze -type f -exec basename "{}" \;)
currentMaildir=$(grep "^Maildir:" "$HOME"/.mblaze/profile | cut -d: -f 2 | sed 's/ //g')
[ -z "$1" ] && basename "$(grep -w "$currentMaildir" -l -R "$HOME"/.config/mblaze)" && exit 0
[ "$1" = "-l" ] && printf '%s\n' "$profiles" && exit 0
profile="$1"
if printf '%s\n' "$profiles" | grep -qw "$profile"; then
cp "$HOME"/.config/mblaze/"$profile" "$HOME"/.mblaze/profile
else
printf '%s\n' "This profile doesn't exist"
fi

View File

@ -1,9 +0,0 @@
#!/bin/sh
random=$(jq 'select(.hidden != true) | select(.removed != true) | select(.name | contains("Proton") | not) | select(.name | contains("Steam") | not) | input_filename' -r "$HOME"/.local/share/cartridges/games/*.json | sort -R | head -n 1)
name=$(jq '.name' -r "$random")
exec=$(jq '.executable | if type == "array" then .[] end' -r "$random")
answer=$(printf "yes\nno" | dmenu -p "Want to play $name?")
[ "$answer" = "yes" ] && eval "$exec" || exit