1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
urosm 466ff6507c Introduce a custom vis-clipboard script 2024-09-29 13:34:46 +02:00
urosm a5098e0885 Drop server specific ssh config 2024-09-28 21:03:32 +02:00
urosm 69411dd2c2 Rename and refactor swaystatus script 2024-09-28 21:01:58 +02:00
6 changed files with 36 additions and 48 deletions

View File

@ -1 +0,0 @@
PermitRootLogin no

View File

@ -1,2 +0,0 @@
PasswordAuthentication no
AuthenticationMethods publickey

View File

@ -51,7 +51,7 @@ set $swaylock swaylock -f \
# bar ##########################################################################
bar {
separator_symbol " | "
status_command status.sh
status_command exec swaystatus
strip_workspace_numbers yes
wrap_scroll yes
colors {

View File

@ -1,44 +0,0 @@
#!/bin/sh
printf "{\"version\":1}\n"
printf "[\n"
if ! command -v jq >/dev/null; then
while :; do
printf '[{ "full_text":"jq: command not found", "urgent":true },],'
sleep 60
done
fi
while :; do
printf "["
# notifications
makoctl list | jq -Mcj '.data[] |
if length>0 then {
"full_text":(["(",length,") ",.[0].summary.data]|join("")),
"urgent":(.[0].urgency.data==2),
} else {
"full_text":"(0)",
} end, ","'
# battery
# shellcheck disable=SC2002
cat /sys/class/power_supply/BAT0/capacity | jq -Mcj '
if .<20 then {
"full_text":([.," %"]|join("")),
"urgent":true,
} else {
"full_text":([.," %"]|join("")),
} end, ","'
# date
date +%c | jq -RMcj '{ "full_text":., }, ","'
# scratchpad
swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] |
select(.name=="__i3_scratch").floating_nodes | {
"full_text":length,
"urgent":length,
}, ","'
printf "],"
# timeout
timeout 1 swaymsg -qt subscribe '["binding"]' >/dev/null
sleep 0.1
done

View File

@ -0,0 +1,28 @@
#!/bin/sh
printf "{\"version\":1}\n"
printf "[\n"
if ! command -v jq >/dev/null; then
while :; do
printf '[{"full_text":"jq: command not found","urgent":true},],'
sleep 60
done
fi
while :; do
printf "["
# notifications
makoctl list | jq -cj '.data[][0] | {"full_text":.summary.data,"urgent":(.urgency.data==2)}, ","'
# battery
# shellcheck disable=SC2002
cat /sys/class/power_supply/BAT0/capacity | jq -cj '{"full_text":((.|tostring)+" %"),"urgent":(.<20)}, ","'
# date
date | jq -Rcj '{"full_text":.}, ","'
# scratchpad
swaymsg -t get_tree | jq -cj 'recurse(.nodes[]) | select(.name=="__i3_scratch").floating_nodes | {"full_text":length,"urgent":length}, ","'
printf "],"
# timeout
timeout 1 swaymsg -qt subscribe '["binding"]' >/dev/null
sleep 0.1
done

View File

@ -0,0 +1,7 @@
#!/bin/sh
case "$1" in
--copy) wl-copy -t TEXT 2>/dev/null;;
--paste) wl-paste --no-newline -t TEXT;;
*) printf "%s [--copy|--paste]\n" "$(basename "$0")" ;;
esac