Refresh clock on the minute instead of every 10 seconds.
This commit is contained in:
parent
a2bdb93d5e
commit
5fa7f918a1
@ -94,7 +94,6 @@ sysutils/lsof
|
|||||||
sysutils/moreutils
|
sysutils/moreutils
|
||||||
sysutils/ncdu
|
sysutils/ncdu
|
||||||
sysutils/nvme-cli
|
sysutils/nvme-cli
|
||||||
sysutils/powermon
|
|
||||||
sysutils/pstree
|
sysutils/pstree
|
||||||
sysutils/pv
|
sysutils/pv
|
||||||
sysutils/radeontop
|
sysutils/radeontop
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
# Do not power devices that have no driver attached.
|
||||||
|
hw.pci.do_power_nodriver=3
|
@ -3,3 +3,13 @@
|
|||||||
# name:
|
# name:
|
||||||
# - foo
|
# - foo
|
||||||
# state: present
|
# state: present
|
||||||
|
|
||||||
|
- name: Install loader.conf
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_loader.conf"
|
||||||
|
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- power_off_no_driver
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
/* Work-around for regressions introduced in 0.9.15 */
|
/* Work-around for regressions introduced in 0.9.15 */
|
||||||
* {
|
* {
|
||||||
all: unset;
|
all: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset all styles */
|
/* Reset all styles */
|
||||||
* {
|
* {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
@ -17,43 +17,43 @@
|
|||||||
* -------------------------------------------------------------------------- */
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
@keyframes blink-warning {
|
@keyframes blink-warning {
|
||||||
70% {
|
70% {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: orange;
|
background-color: orange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes blink-critical {
|
@keyframes blink-critical {
|
||||||
70% {
|
70% {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
color: white;
|
color: white;
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Base styles
|
* Base styles
|
||||||
* -------------------------------------------------------------------------- */
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
/* The whole bar */
|
/* The whole bar */
|
||||||
#waybar {
|
#waybar {
|
||||||
background: #323232;
|
background: #323232;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: Cascadia Mono, monospace;
|
font-family:
|
||||||
font-size: 10px;
|
Cascadia Mono,
|
||||||
|
monospace;
|
||||||
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltip {
|
tooltip {
|
||||||
background-color: #323232;
|
background-color: #323232;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Each module */
|
/* Each module */
|
||||||
@ -65,7 +65,6 @@ tooltip {
|
|||||||
#custom-clock,
|
#custom-clock,
|
||||||
#custom-sound,
|
#custom-sound,
|
||||||
#custom-temperature,
|
#custom-temperature,
|
||||||
#custom-recording_indicator,
|
|
||||||
#idle_inhibitor,
|
#idle_inhibitor,
|
||||||
#memory,
|
#memory,
|
||||||
#mode,
|
#mode,
|
||||||
@ -73,46 +72,45 @@ tooltip {
|
|||||||
#pulseaudio,
|
#pulseaudio,
|
||||||
#temperature,
|
#temperature,
|
||||||
#tray {
|
#tray {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Module styles
|
* Module styles
|
||||||
* -------------------------------------------------------------------------- */
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#battery {
|
#battery {
|
||||||
animation-timing-function: linear;
|
animation-timing-function: linear;
|
||||||
animation-iteration-count: infinite;
|
animation-iteration-count: infinite;
|
||||||
animation-direction: alternate;
|
animation-direction: alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-battery.warning {
|
#custom-battery.warning {
|
||||||
color: orange;
|
color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-battery.critical {
|
#custom-battery.critical {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
#battery.warning.discharging {
|
#battery.warning.discharging {
|
||||||
animation-name: blink-warning;
|
animation-name: blink-warning;
|
||||||
animation-duration: 3s;
|
animation-duration: 3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#battery.critical.discharging {
|
#battery.critical.discharging {
|
||||||
animation-name: blink-critical;
|
animation-name: blink-critical;
|
||||||
animation-duration: 2s;
|
animation-duration: 2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock {
|
#clock {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-clock {
|
#custom-clock {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cpu {
|
#cpu {
|
||||||
@ -120,92 +118,88 @@ tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#cpu.warning {
|
#cpu.warning {
|
||||||
color: orange;
|
color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cpu.critical {
|
#cpu.critical {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
#memory {
|
#memory {
|
||||||
animation-timing-function: linear;
|
animation-timing-function: linear;
|
||||||
animation-iteration-count: infinite;
|
animation-iteration-count: infinite;
|
||||||
animation-direction: alternate;
|
animation-direction: alternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#memory.warning {
|
#memory.warning {
|
||||||
color: orange;
|
color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
#memory.critical {
|
#memory.critical {
|
||||||
color: red;
|
color: red;
|
||||||
animation-name: blink-critical;
|
animation-name: blink-critical;
|
||||||
animation-duration: 2s;
|
animation-duration: 2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mode {
|
#mode {
|
||||||
background: #64727D;
|
background: #64727d;
|
||||||
border-top: 2px solid white;
|
border-top: 2px solid white;
|
||||||
/* To compensate for the top border and still have vertical centering */
|
/* To compensate for the top border and still have vertical centering */
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#network {
|
#network {
|
||||||
/* No styles */
|
/* No styles */
|
||||||
}
|
}
|
||||||
|
|
||||||
#network.disconnected {
|
#network.disconnected {
|
||||||
color: orange;
|
color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pulseaudio {
|
#pulseaudio {
|
||||||
/* No styles */
|
/* No styles */
|
||||||
}
|
}
|
||||||
|
|
||||||
#pulseaudio.muted {
|
#pulseaudio.muted {
|
||||||
/* No styles */
|
/* No styles */
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-spotify {
|
#custom-spotify {
|
||||||
color: rgb(102, 220, 105);
|
color: rgb(102, 220, 105);
|
||||||
}
|
}
|
||||||
|
|
||||||
#temperature {
|
#temperature {
|
||||||
/* No styles */
|
/* No styles */
|
||||||
}
|
}
|
||||||
|
|
||||||
#temperature.critical {
|
#temperature.critical {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
#tray {
|
#tray {
|
||||||
/* No styles */
|
/* No styles */
|
||||||
}
|
}
|
||||||
|
|
||||||
#window {
|
#window {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button {
|
#workspaces button {
|
||||||
border-top: 2px solid transparent;
|
border-top: 2px solid transparent;
|
||||||
/* To compensate for the top border and still have vertical centering */
|
/* To compensate for the top border and still have vertical centering */
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
color: #888888;
|
color: #888888;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button.focused {
|
#workspaces button.focused {
|
||||||
border-color: #4c7899;
|
border-color: #4c7899;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #285577;
|
background-color: #285577;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button.urgent {
|
#workspaces button.urgent {
|
||||||
border-color: #c9545d;
|
border-color: #c9545d;
|
||||||
color: #c9545d;
|
color: #c9545d;
|
||||||
}
|
|
||||||
|
|
||||||
#custom-recording_indicator {
|
|
||||||
color: red;
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
// "height": 10, // Waybar height (to be removed for auto height)
|
// "height": 10, // Waybar height (to be removed for auto height)
|
||||||
"modules-left": ["sway/workspaces", "sway/mode", "custom/recording_indicator"],
|
"modules-left": ["sway/workspaces", "sway/mode"],
|
||||||
"modules-right": ["custom/temperature", "custom/sound", "custom/available_memory", "custom/battery", "idle_inhibitor", "custom/clock", "tray"],
|
"modules-right": ["custom/temperature", "custom/sound", "custom/available_memory", "custom/battery", "idle_inhibitor", "custom/clock", "tray"],
|
||||||
"sway/workspaces": {
|
"sway/workspaces": {
|
||||||
"disable-scroll": true
|
"disable-scroll": true
|
||||||
@ -43,10 +43,5 @@
|
|||||||
"exec": "waybar_custom_temperature",
|
"exec": "waybar_custom_temperature",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"restart-interval": 30
|
"restart-interval": 30
|
||||||
},
|
|
||||||
"custom/recording_indicator": {
|
|
||||||
"exec": "waybar_custom_recording_indicator",
|
|
||||||
"return-type": "json",
|
|
||||||
"restart-interval": 30
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ from functools import lru_cache
|
|||||||
from typing import Final, List, Optional
|
from typing import Final, List, Optional
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
INTERVAL: Final[int] = 10
|
|
||||||
LOCAL_TIMEZONE = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo
|
LOCAL_TIMEZONE = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo
|
||||||
|
|
||||||
|
|
||||||
@ -87,10 +86,10 @@ def main():
|
|||||||
time_before_next_update = next_update - time.time()
|
time_before_next_update = next_update - time.time()
|
||||||
if time_before_next_update > 0:
|
if time_before_next_update > 0:
|
||||||
time.sleep(time_before_next_update)
|
time.sleep(time_before_next_update)
|
||||||
next_update = time.time() + INTERVAL
|
next_update = 60 * (1 + int(time.time()) // 60)
|
||||||
|
|
||||||
now = datetime.datetime.now(tz=tz)
|
now = datetime.datetime.now(tz=tz)
|
||||||
text = now.strftime("%Y-%m-%d %H:%M")
|
text = now.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
tooltip = make_calendar(now.date(), tz)
|
tooltip = make_calendar(now.date(), tz)
|
||||||
|
|
||||||
out = Update(
|
out = Update(
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Report screen recording status in FreeBSD
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
|
|
||||||
SLEEP_INTERVAL=${SLEEP_INTERVAL:-10}
|
|
||||||
DELAY_ACTION=${DELAY_ACTION:-2}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
local previous_reported="-1"
|
|
||||||
local now=$(date +%s)
|
|
||||||
local check_again_at=$((now + SLEEP_INTERVAL))
|
|
||||||
local next_sleep_interval=$SLEEP_INTERVAL
|
|
||||||
|
|
||||||
stream_key_binding_activations | while true; do
|
|
||||||
if read -t "$next_sleep_interval" event; then
|
|
||||||
now=$(date +%s)
|
|
||||||
latest_allowed_check=$((now + DELAY_ACTION))
|
|
||||||
if [ "$latest_allowed_check" -lt "$check_again_at" ]; then
|
|
||||||
# Scheduling a debounced action
|
|
||||||
check_again_at=$latest_allowed_check
|
|
||||||
next_sleep_interval=$DELAY_ACTION
|
|
||||||
else
|
|
||||||
# New debounced event would trigger after a check is already scheduled
|
|
||||||
next_sleep_interval=$((check_again_at - now))
|
|
||||||
fi
|
|
||||||
if [ "$now" -lt "$check_again_at" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if pgrep -q wl-screenrec; then
|
|
||||||
local is_running=1
|
|
||||||
else
|
|
||||||
local is_running=0
|
|
||||||
fi
|
|
||||||
if [ "$is_running" -ne "$previous_reported" ]; then
|
|
||||||
previous_reported="$is_running"
|
|
||||||
report "$is_running"
|
|
||||||
fi
|
|
||||||
|
|
||||||
now=$(date +%s)
|
|
||||||
check_again_at=$((now + SLEEP_INTERVAL))
|
|
||||||
next_sleep_interval=$SLEEP_INTERVAL
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function stream_key_binding_activations {
|
|
||||||
echo "{}"
|
|
||||||
swaymsg --raw --monitor --type subscribe '[ "binding" ]'
|
|
||||||
}
|
|
||||||
|
|
||||||
function report {
|
|
||||||
is_running="$1"
|
|
||||||
if [ "$is_running" -eq 0 ]; then
|
|
||||||
jq --unbuffered --compact-output <<EOF
|
|
||||||
{
|
|
||||||
"text":"",
|
|
||||||
"tooltip":"Not recording",
|
|
||||||
"percentage":0,
|
|
||||||
"class":"hidden"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
jq --unbuffered --compact-output <<EOF
|
|
||||||
{
|
|
||||||
"text":"⏺",
|
|
||||||
"tooltip":"Recording",
|
|
||||||
"percentage":100,
|
|
||||||
"class":"visible"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main "${@}"
|
|
@ -21,5 +21,3 @@
|
|||||||
dest: /usr/local/bin/waybar_custom_sound
|
dest: /usr/local/bin/waybar_custom_sound
|
||||||
- src: waybar_temperature_freebsd.bash
|
- src: waybar_temperature_freebsd.bash
|
||||||
dest: /usr/local/bin/waybar_custom_temperature
|
dest: /usr/local/bin/waybar_custom_temperature
|
||||||
- src: waybar_recording_indicator_freebsd.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_recording_indicator
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user