diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/battery.nix | 6 | ||||
-rw-r--r-- | scripts/default.nix | 6 | ||||
-rw-r--r-- | scripts/up.nix | 8 |
3 files changed, 16 insertions, 4 deletions
diff --git a/scripts/battery.nix b/scripts/battery.nix index 87b6cff..3aed4f9 100644 --- a/scripts/battery.nix +++ b/scripts/battery.nix | |||
@@ -17,6 +17,12 @@ pkgs.writeScriptBin name | |||
17 | 17 | ||
18 | bat_status="" | 18 | bat_status="" |
19 | bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) | 19 | bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) |
20 | |||
21 | if [ -z $bat_status ]; then | ||
22 | echo -ne "#[fg=color2]${symbol} #[fg=colour8]$HOSTNAME" | ||
23 | exit 0 | ||
24 | fi | ||
25 | |||
20 | charging_status=$( cat /sys/class/power_supply/BAT0/status ) | 26 | charging_status=$( cat /sys/class/power_supply/BAT0/status ) |
21 | 27 | ||
22 | health() { | 28 | health() { |
diff --git a/scripts/default.nix b/scripts/default.nix index c7a485c..59b1ca5 100644 --- a/scripts/default.nix +++ b/scripts/default.nix | |||
@@ -64,6 +64,11 @@ let | |||
64 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} | 64 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} |
65 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} | 65 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} |
66 | ''; | 66 | ''; |
67 | portrait2 = pkgs.writeScriptBin "portrait2" '' | ||
68 | ${pkgs.xorg.xrandr}/bin/xrandr -o right | ||
69 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} | ||
70 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} | ||
71 | ''; | ||
67 | landscape = pkgs.writeScriptBin "landscape" '' | 72 | landscape = pkgs.writeScriptBin "landscape" '' |
68 | ${pkgs.xorg.xrandr}/bin/xrandr -o normal | 73 | ${pkgs.xorg.xrandr}/bin/xrandr -o normal |
69 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} | 74 | ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} |
@@ -82,6 +87,7 @@ in | |||
82 | battery | 87 | battery |
83 | tmux-fzf | 88 | tmux-fzf |
84 | portrait | 89 | portrait |
90 | portrait2 | ||
85 | landscape | 91 | landscape |
86 | nvidia-offload | 92 | nvidia-offload |
87 | m2m | 93 | m2m |
diff --git a/scripts/up.nix b/scripts/up.nix index c4f7c7a..0217b6b 100644 --- a/scripts/up.nix +++ b/scripts/up.nix | |||
@@ -13,10 +13,10 @@ pkgs.writeScriptBin name | |||
13 | if [ -f "$1" ]; then | 13 | if [ -f "$1" ]; then |
14 | ext="''${1##*.}" | 14 | ext="''${1##*.}" |
15 | id="$id.$ext" | 15 | id="$id.$ext" |
16 | scp "$1" ferrn:~/www/nerd/uploads/"$id" | 16 | scp "$1" kombu:/var/www/uploads/"$id" |
17 | echo "https://u.peppe.rs/$id" | 17 | echo "https://cdn.oppi.li/$id" |
18 | echo "https://u.peppe.rs/$id" | ${xclip} -selection clipboard | 18 | echo "https://cdn.oppi.li/$id" | ${xclip} -selection clipboard |
19 | echo "https://u.peppe.rs/$id" | ${xclip} -i | 19 | echo "https://cdn.oppi.li/$id" | ${xclip} -i |
20 | else | 20 | else |
21 | echo "file does not exist" | 21 | echo "file does not exist" |
22 | fi | 22 | fi |