....
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
# Settings
|
||||
battery_percent_MODULUS=5 # How many percent difference are required for another update
|
||||
INTERVAL=5 # The interval at which to check the battery percentage
|
||||
INTERVAL=20 # The interval at which to check the battery percentage
|
||||
ALERT_SCRIPT="sudo /home/mia/Scripts/keyboard_alert.sh"
|
||||
|
||||
# Battery Levels
|
||||
BAT_RECOMMENDED_UPPER_LIMIT=80
|
||||
BAT_RECOMMENDED_LOWER_LIMIT=40
|
||||
BAT_SLIGHTLY_LOW=30
|
||||
BAT_LOW=20
|
||||
BAT_RECOMMENDED_LOWER_LIMIT=30
|
||||
BAT_SLIGHTLY_LOW=25
|
||||
BAT_LOW=17
|
||||
BAT_VERY_LOW=10
|
||||
BAT_HIB=5
|
||||
|
||||
@@ -23,13 +23,13 @@ get_percentage()
|
||||
|
||||
countdown()
|
||||
{
|
||||
for i in $(seq 1 10);
|
||||
for i in $(seq 1 15);
|
||||
do
|
||||
if [[ $(cat /sys/bus/acpi/drivers/battery/*/power_supply/BAT?/status) = "Charging" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
sleep 4
|
||||
notify-send $((10-$i)) -u critical
|
||||
done
|
||||
systemctl hibernate
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CONFIG_REPO_LOCATION=~/work/config
|
||||
CHARYBDIS_DISK_LOCATION=/dev/disk/by-uuid/0042-0042
|
||||
|
||||
|
||||
# use the fusefatfs packaged in my nurPkgs
|
||||
alias fusefatfs="$(nix build ${CONFIG_REPO_LOCATION}#mynurPkgs.fusefatfs --no-keep-outputs --print-out-paths)/bin/fusefatfs"
|
||||
export fusefatfs="$(nix build ${CONFIG_REPO_LOCATION}#mynurPkgs.fusefatfs --no-keep-outputs --print-out-paths)/bin/fusefatfs"
|
||||
|
||||
|
||||
# if we have a keyboard config like thing in the clipboard.... use that
|
||||
@@ -15,18 +17,34 @@ if [[ "$(wl-paste | head -n 4)" == '#include <dt-bindings/zmk/mouse.h>
|
||||
#include <dt-bindings/zmk/keys.h>' ]]
|
||||
then
|
||||
echo pasting keyboard config from clipboard
|
||||
wl-paste > $CONFIG_REPO_LOCATION/zmk-config/config/charybdis.keymap
|
||||
wl-paste | grep -v "bindings/zmk/pointing" > $CONFIG_REPO_LOCATION/zmk-config/config/charybdis.keymap
|
||||
fi
|
||||
|
||||
mkdir -p $TMP/keyboard-flash-mnt
|
||||
exit
|
||||
sudo mkdir -p /tmp/keyboard-flash-mnt
|
||||
|
||||
sudo fusefatfs $CHARYBDIS_DISK_LOCATION $TMP/keyboard-flash-mnt
|
||||
# error checking if device exists
|
||||
if [[ ! -L $CHARYBDIS_DISK_LOCATION ]]
|
||||
then
|
||||
echo err: keyboard not in bootloader mode
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo before build
|
||||
|
||||
firmware_out_path=$(nix build .#random.keyboardRight -L --no-keep-outputs --print-out-paths)
|
||||
if [[ $1 == "left" ]]
|
||||
then
|
||||
firmware_out_path=$(nix build ${CONFIG_REPO_LOCATION}#random.keyboardLeft -L --no-keep-outputs --print-out-paths)
|
||||
else
|
||||
firmware_out_path=$(nix build ${CONFIG_REPO_LOCATION}#random.keyboardRight -L --no-keep-outputs --print-out-paths)
|
||||
fi
|
||||
echo firmware at: $firmware_out_path
|
||||
|
||||
sudo cp $firmware_out_path #NEXT: what to copy where
|
||||
# flashing by writing to device directly
|
||||
#sudo dd if=$firmware_out_path/zmk.uf2 of=$CHARYBDIS_DISK_LOCATION
|
||||
|
||||
sudo umount $TMP/keyboard-flash-mnt
|
||||
# flashing by mounting
|
||||
sudo $fusefatfs -o rw+ $CHARYBDIS_DISK_LOCATION /tmp/keyboard-flash-mnt
|
||||
|
||||
sudo cp $firmware_out_path/zmk.uf2 /tmp/keyboard-flash-mnt/CURRENT.UF2 || true
|
||||
|
||||
sudo umount /tmp/keyboard-flash-mnt
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
path="/home/mia/Pictures/Screenshots/screen.png"
|
||||
grim "$path" &&
|
||||
corrupter -add 0 -bheight 20 -stdabber 10 -boffset 50 "$path" "$path" &&
|
||||
|
||||
swaylock -c /home/mia/.config/swaylock/config &&
|
||||
swaymsg "output * dpms on"
|
||||
@@ -9,7 +9,7 @@ default_vm_uuid=win
|
||||
#default_vm_uuid=6a412143-871f-4838-bacd-5dcfa5fa95c3
|
||||
|
||||
username=me
|
||||
password=$(cat ~/work/here/secrets/win-vm-pwd)
|
||||
password=$(cat ~/secrets/win-vm-pwd)
|
||||
|
||||
if [ "$1" == "-o" ];then
|
||||
cmd=$5
|
||||
@@ -119,6 +119,9 @@ elif [ "$cmd" == "f" ];then
|
||||
#xfreerdp ${RDP_FLAGS} /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} /scale:${RDP_SCALE} /dynamic-resolution +clipboard +auto-reconnect +home-drive /wm-class:"Microsoft Windows" -grab-keyboard
|
||||
#
|
||||
elif [ "$cmd" == "fl" ];then
|
||||
echo username: $username
|
||||
echo ip: $default_vm_ip
|
||||
|
||||
RDP_SCALE=100
|
||||
MULTI_FLAG="span"
|
||||
RDP_USER=$username
|
||||
|
||||
Reference in New Issue
Block a user