update waybar config

This commit is contained in:
Christophe Robillard 2025-08-11 19:23:46 +02:00
parent b6363d761c
commit 6f96a9b306
7 changed files with 334 additions and 7 deletions

View file

@ -17,15 +17,16 @@
"height": 30,
"position": "bottom",
"modules-left": ["custom/menu", "sway/workspaces", "custom/scratchpad"],
"modules-left": ["custom/menu", "sway/workspaces", "custom/scratchpad", "custom/watson" ],
"modules-center": [
"custom/wf-recorder",
"sway/mode",
"custom/weather",
"sway/window"
// "sway/window",
"custom/uair"
],
"modules-right": [
// informational
"custom/weather",
"sway/language",
"custom/github",
"custom/clipboard",
@ -44,10 +45,10 @@
"custom/idle_inhibitor",
"custom/dnd",
"pulseaudio",
"backlight",
// "backlight",
// system
// "custom/adaptive-light",
"custom/adaptive-light",
// "custom/sunset",
"custom/pacman",
@ -284,7 +285,8 @@
// accepts -c/--city <city> -t/--temperature <C/F> -d/--distance <km/miles>
"exec": "/usr/share/sway/scripts/weather.py",
"return-type": "json",
"on-click": "xdg-open \"https://wttr.in/$(curl -s https://manjaro-sway.download/geoip | jq -r '.city')\"",
// "on-click": "xdg-open \"https://wttr.in/$(curl -s https://manjaro-sway.download/geoip | jq -r '.city')\"",
"on-click": "xdg-open \"https://wttr.in/Chateldon",
"on-click-right": "waybar-signal weather",
"signal": 16
},
@ -363,5 +365,40 @@
"on-click": "inhibit-idle off; inhibit-idle interactive",
"on-click-middle": "inhibit-idle off",
"signal": 15
},
"custom/uair": {
// "format": "{icon} {percentage}",
"format": "{icon} {text}",
"format-icons": [
"○○○○○○○○○●",
"○○○○○○○○●●",
"○○○○○○○●●●",
"○○○○○○●●●●",
"○○○○○●●●●●",
"○○○○●●●●●●",
"○○○●●●●●●●",
"○○●●●●●●●●",
"○●●●●●●●●●",
"●●●●●●●●●●"
],
"tooltip": false,
"return-type": "json",
"interval": 5,
"on-click": "uairctl toggle",
"on-click-middle": "uairctl prev",
"on-click-right": "uairctl next",
"exec-if": "pidof uair",
"exec": "uairctl fetch '{\"text\":\"{name}\",\"class\":\"{state}\",\"percentage\":{percent}}'"
// "exec": "uairctl fetch '{\"text\":\"{name} {time} {percent}%\",\"name\":\"{name}\",\"class\":\"{state}\",\"percentage\":{percent}}'"
},
"custom/watson": {
"format": "<span weight=\"ultrabold\">{text}</span>",
"return-type": "json",
"interval": 10,
"exec": "/home/krichtof/src/watson/waybar-watson.py"
}
}

9
waybar/draft Normal file
View file

@ -0,0 +1,9 @@
A mon tour de vous remercier pour votre réponse enthousiasmante.
Comme indiqué dans la présentation que je vous ai partagée, je suis dans la phase où j'interroge plusieurs profils pour définir plus précisément le problème que je souhaite adresser (plutôt que développer mon projet en chambre)
J'ai effectué quelques entretiens avec des personnes sujettes à des troubles de l'humeur. Je compte en faire également avec des aidants, ainsi qu'avec des professionnels de santé.
Y aurait-il des personnes de votre équipe qui seraient d'accord pour répondre à mes questions ?
Au plaisir de vous lire,
Christophe Robillard

1
waybar/gh.json Normal file

File diff suppressed because one or more lines are too long

26
waybar/mocha.css Normal file
View file

@ -0,0 +1,26 @@
@define-color rosewater #f5e0dc;
@define-color flamingo #f2cdcd;
@define-color pink #f5c2e7;
@define-color mauve #cba6f7;
@define-color red #f38ba8;
@define-color maroon #eba0ac;
@define-color peach #fab387;
@define-color yellow #f9e2af;
@define-color green #a6e3a1;
@define-color teal #94e2d5;
@define-color sky #89dceb;
@define-color sapphire #74c7ec;
@define-color blue #89b4fa;
@define-color lavender #b4befe;
@define-color text #cdd6f4;
@define-color subtext1 #bac2de;
@define-color subtext0 #a6adc8;
@define-color overlay2 #9399b2;
@define-color overlay1 #7f849c;
@define-color overlay0 #6c7086;
@define-color surface2 #585b70;
@define-color surface1 #45475a;
@define-color surface0 #313244;
@define-color base #1e1e2e;
@define-color mantle #181825;
@define-color crust #11111b;

View file

@ -1 +1,4 @@
@import "/usr/share/sway/templates/waybar/style.css";
#custom-uair.resumed {
color: #f87171;
}

217
waybar/style_mocha.css Normal file
View file

@ -0,0 +1,217 @@
@import "mocha.css";
/* =============================================================================
*
* Waybar configuration
*
* Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
*
* =========================================================================== */
/* import css definitions for current theme */
/* -----------------------------------------------------------------------------
* Keyframes
* -------------------------------------------------------------------------- */
@keyframes blink-warning {
70% {
color: @wm_icon_bg;
}
to {
color: @wm_icon_bg;
background-color: @warning_color;
}
}
@keyframes blink-critical {
70% {
color: @wm_icon_bg;
}
to {
color: @wm_icon_bg;
background-color: @error_color;
}
}
/* -----------------------------------------------------------------------------
* Base styles
* -------------------------------------------------------------------------- */
/* Reset all styles */
* {
border: none;
border-radius: 0;
min-height: 0;
margin: 0;
padding: 0;
font-family: "JetBrainsMono NF", "Roboto Mono", sans-serif;
color: @text;
}
window#waybar {
/* you can also GTK3 CSS functions! */
background-color: shade(@base, 0.9);
border: 2px solid alpha(@crust, 0.3);
}
/* Each module */
#custom-pacman,
#custom-menu,
#custom-help,
#custom-scratchpad,
#custom-github,
#custom-clipboard,
#custom-zeit,
#custom-dnd,
#custom-valent,
#custom-idle_inhibitor,
#bluetooth,
#battery,
#clock,
#cpu,
#memory,
#mode,
#network,
#pulseaudio,
#temperature,
#backlight,
#language,
#custom-adaptive-light,
#custom-sunset,
#custom-playerctl,
#custom-weather,
#tray {
padding-left: 10px;
padding-right: 10px;
}
/* -----------------------------------------------------------------------------
* Module styles
* -------------------------------------------------------------------------- */
#custom-scratchpad,
#custom-menu,
#workspaces button.focused,
#clock {
color: @theme_bg_color;
background-color: @theme_selected_bg_color;
}
#custom-zeit.tracking {
background-color: @warning_color;
}
#battery {
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#battery.warning {
color: @warning_color;
}
#battery.critical {
color: @error_color;
}
#battery.warning.discharging {
animation-name: blink-warning;
animation-duration: 3s;
}
#battery.critical.discharging {
animation-name: blink-critical;
animation-duration: 2s;
}
#clock {
font-weight: bold;
}
#cpu.warning {
color: @warning_color;
}
#cpu.critical {
color: @error_color;
}
#custom-menu {
padding-left: 8px;
padding-right: 13px;
}
#memory {
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#memory.warning {
color: @warning_color;
}
#memory.critical {
color: @error_color;
animation-name: blink-critical;
animation-duration: 2s;
}
#mode {
background: @background_color;
}
#network.disconnected {
color: @warning_color;
}
#pulseaudio.muted {
color: @warning_color;
}
#temperature.critical {
color: @error_color;
}
#workspaces button {
border-top: 2px solid transparent;
/* To compensate for the top border and still have vertical centering */
padding-bottom: 2px;
padding-left: 10px;
padding-right: 10px;
color: @theme_selected_bg_color;
}
#workspaces button.focused {
border-color: @theme_selected_bg_color;
}
#workspaces button.urgent {
border-color: @error_color;
color: @error_color;
}
#workspaces button:hover {
color: @theme_bg_color;
}
#custom-pacman {
color: @warning_color;
}
#bluetooth.disabled {
color: @warning_color;
}
#custom-wf-recorder {
color: @error_color;
padding-right: 10px;
}
#custom-valent.dangerously-empty {
color: @warning_color;
}

34
waybar/zeit.sh Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env sh
tracking=$(zeit tracking --no-colors)
case $1'' in
'status')
text=$(echo "$tracking" | sed -z 's/\n/\\n/g' | grep -q 'tracking' && echo "tracking" || echo "stopped")
tooltip=$tracking'\r(zeit time tracker)'
echo "{\"text\":\"$text\",\"tooltip\":\"$tooltip\",\"class\":\"$text\",\"alt\":\"$text\"}"
;;
'click')
if echo "$tracking" | grep -q 'tracking'; then
zeit finish
else
swaymsg exec \$zeit_list
fi
;;
'light-status')
text=$(echo "$tracking" | sed -z 's/\n/\\n/g' | grep -q 'tracking' && echo "tracking" || echo "stopped")
echo "{\"text\":\"$tracking\",\"class\":\"$text\",\"alt\":\"$text\"}"
;;
'track')
input=$(cat -)
task=$(echo $input | pcregrep -io1 '└── (.+) \[.+')
project=$(echo $input | pcregrep -io1 '.+\[(.+)\]')
if [ "$task" = "" ] || [ "$project" = "" ]; then
notify-send "You did not select a task!"
exit 1
fi
zeit track -p "$project" -t "$task"
notify-send "Tracking $task in $project"
;;
esac