waybar: move to systemd service, update clock
This commit is contained in:
parent
650b741777
commit
2e9119018c
5 changed files with 44 additions and 24 deletions
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
CONFIG_DIR=$HOME/.config/sway/waybar.d
|
||||
CONFIG=$CONFIG_DIR/config
|
||||
CONFIG_HOST=$CONFIG_DIR/config_$(hostname)
|
||||
if [ -f $CONFIG_HOST ]; then
|
||||
CONFIG=$CONFIG_HOST
|
||||
fi
|
||||
STYLE=$CONFIG_DIR/style.css
|
||||
|
||||
# Terminate already running bar instances
|
||||
# pkill -SIGUSR2 -x waybar
|
||||
pkill -x waybar
|
||||
# execute new instance
|
||||
waybar -c $CONFIG -s $STYLE
|
||||
|
6
config
6
config
|
@ -22,7 +22,6 @@ set $output_cmd $HOME/.local/bin/swayout
|
|||
set $volume_cmd $HOME/.config/sway/bin/sway_volume
|
||||
set $media_cmd /usr/bin/playerctl
|
||||
set $idle_cmd $HOME/.config/sway/bin/start_swayidle.sh
|
||||
set $waybar_cmd $HOME/.config/sway/bin/start_waybar.sh
|
||||
set $sov_cmd $HOME/.config/sway/bin/start_sov.sh
|
||||
set $lock_cmd $HOME/.config/sway/bin/sway_lock lock
|
||||
set $move_cmd $HOME/.config/sway/bin/sway_move
|
||||
|
@ -364,11 +363,6 @@ for_window [class="Chromium" instance="crx_cifhbcnohmdccbgoicgdjpfamggdegmo" win
|
|||
# matlab workaround
|
||||
no_focus [class="MATLAB R2021a" instance="sun-awt-X11-XDialogPeer"]
|
||||
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
exec_always $waybar_cmd
|
||||
|
||||
#
|
||||
# Autostart
|
||||
#
|
||||
|
|
6
systemd/user/sway-session.target
Normal file
6
systemd/user/sway-session.target
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Sway compositor session
|
||||
Documentation=man:systemd.special
|
||||
BindsTo=graphical-session.target
|
||||
Wants=graphical-session-pre.target
|
||||
After=graphical-session-pre.target
|
14
systemd/user/waybar.service
Normal file
14
systemd/user/waybar.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
|
||||
Documentation=https://github.com/Alexays/Waybar/wiki/
|
||||
PartOf=graphical-session.target
|
||||
After=graphical-session.target
|
||||
Requisite=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=env LC_TIME=de_DE.UTF-8 /usr/bin/waybar
|
||||
ExecReload=kill -SIGUSR2 $MAINPID
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
|
@ -83,8 +83,30 @@
|
|||
"exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null"
|
||||
},
|
||||
"clock": {
|
||||
"format": "<span foreground='#ebdbb2'></span>{: %H:%M, %b %d }",
|
||||
// "on-click": "foot -T float khal interactive"
|
||||
"format": "<span foreground='#ebdbb2'> </span>{:%H:%M, %b %d}",
|
||||
"format-alt": "<span foreground='#ebdbb2'> </span>{:%A, %B %d, %Y (%R)}",
|
||||
"tooltip-format": "\n<span size='9pt'>{calendar}</span>",
|
||||
"calendar": {
|
||||
"mode" : "year",
|
||||
"mode-mon-col" : 3,
|
||||
"weeks-pos" : "right",
|
||||
"on-scroll" : 1,
|
||||
"on-click-right": "mode",
|
||||
"format": {
|
||||
"months": "<span color='#ebdbb2'><b>{}</b></span>",
|
||||
"days": "<span color='#ebdbb2'><b>{}</b></span>",
|
||||
"weeks": "<span color='#268bd2'><b>W{}</b></span>",
|
||||
"weekdays": "<span color='#b8bb26'><b>{}</b></span>",
|
||||
"today": "<span color='#fb4934'><b><u>{}</u></b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "mode",
|
||||
"on-click-forward": "tz_up",
|
||||
"on-click-backward": "tz_down",
|
||||
"on-scroll-up": "shift_up",
|
||||
"on-scroll-down": "shift_down"
|
||||
}
|
||||
},
|
||||
"cpu": {
|
||||
"format": "<span foreground='#ebdbb2'></span>{usage:3}%",
|
||||
|
|
Loading…
Reference in a new issue