Compare commits
3 Commits
ef942c9549
...
466ff6507c
Author | SHA1 | Date |
---|---|---|
urosm | 466ff6507c | |
urosm | a5098e0885 | |
urosm | 69411dd2c2 |
|
@ -1 +0,0 @@
|
|||
PermitRootLogin no
|
|
@ -1,2 +0,0 @@
|
|||
PasswordAuthentication no
|
||||
AuthenticationMethods publickey
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue