configs: Added sample waybar config

This also adds a few lines to the example hooks to toggle between the
configs depending on the state of the computer
This commit is contained in:
Yuki Joou 2023-07-21 02:49:04 +02:00
parent 813aa15886
commit 2049494676
5 changed files with 313 additions and 0 deletions

View file

@ -4,3 +4,7 @@ notify-send "Basestation connected";
# Disable osk # Disable osk
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false
# Swap waybar
pkill waybar
waybar -c ~/.config/waybar/config-docked

View file

@ -4,3 +4,7 @@ notify-send "Basestation disconnected";
# Enable on-screen keyboard # Enable on-screen keyboard
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
# Swap waybar
pkill waybar
waybar -c ~/.config/waybar/config-tablet

View file

@ -0,0 +1,63 @@
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad"],
"modules-center": ["sway/window"],
"modules-right": ["cpu", "memory", "temperature", "backlight", "battery", "tray", "clock"],
// Modules configuration
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "PROC {usage}%",
"tooltip": false
},
"memory": {
"format": "MEM {}%"
},
"temperature": {
"thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C"
},
"backlight": {
// "device": "acpi_video1",
"format": "BKL {percent}%"
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "BAT {capacity}%",
"format-charging": "CHR {capacity}%",
"format-plugged": "CHR {capacity}%"
// "format-good": "", // An empty format will hide the module
// "format-full": "",
}
}

View file

@ -0,0 +1,103 @@
[
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 40, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 0, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad"],
"modules-center": ["sway/window"],
"modules-right": ["custom/close", "battery", "clock"],
// Modules configuration
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"custom/close": {
"exec": "~/.config/waybar/close-module.sh",
"on-click": "swaymsg kill",
"restart-interval": 1
},
"clock": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "PROC {usage}%",
"tooltip": false
},
"memory": {
"format": "MEM {}%"
},
"temperature": {
"thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C"
},
"backlight": {
// "device": "acpi_video1",
"format": "BKL {percent}%"
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}%",
"format-charging": "+{capacity}%",
"format-plugged": "+{capacity}%"
// "format-good": "", // An empty format will hide the module
// "format-full": "",
}
},
{
"position": "bottom",
"height": 40,
"modules-left": ["custom/launcher"],
"modules-right": ["custom/volume-plus", "custom/volume-minus", "custom/bright-plus", "custom/bright-minus", "tray"],
"custom/launcher": {
"format": "APP",
"on-click": "pkill rofi || rofi -show combi -combi-modes drun"
},
"custom/volume-plus": {
"format": "🔊",
"on-click": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
},
"custom/volume-minus": {
"format": "🔉",
"on-click": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
},
"custom/bright-plus": {
"format": "🌞+",
"on-click": "light -A 5"
},
"custom/bright-minus": {
"format": "🌞-",
"on-click": "light -U 5"
},
"tray": {
"icon-size": 22,
"spacing": 10
},
}
]

139
configs/waybar/style.css Normal file
View file

@ -0,0 +1,139 @@
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: 'Atkinson Hyperlegible';
font-size: 13px;
}
window#waybar {
background-color: rgba(59, 4, 59, 0.5);
border-bottom: 3px solid rgba(59, 4, 125, 0.2);
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
button {
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
/* Avoid rounded borders under each button name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
box-shadow: inset 0 -3px #ffffff;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: white;
}
#workspaces button:hover {
background: rgba(128, 128, 128, 0.4);
}
#workspaces button.focused {
background-color: rgba(128, 64, 128, 0.4);
box-shadow: inset 0 -3px #ffffff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: rgba(128, 64, 128, 0.4);
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#mpd,
#custom-close,
#custom-launcher,
#custom-bright-plus,
#custom-bright-minus,
#custom-volume-plus,
#custom-volume-minus{
padding: 0 10px;
color: rgb(255, 255, 255);
background-color: rgba(255, 255, 255, 0.4);
}
#custom-close {
margin: 0 20px;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}