Initial support for sway and waybar

This commit is contained in:
Christian Colglazier 2021-10-22 16:37:11 -04:00
parent 4c078fd92a
commit 4812b349b5
5 changed files with 309 additions and 2 deletions

View File

@ -173,6 +173,7 @@ exec_always --no-startup-id setxkbmap -option 'caps:super'
# Startup scripts
exec --no-startup-id sh ~/.config/scripts/connect-nas.sh
exec --no-startup-id systemctl --user start polybar
exec --no-startup-id waybar &
# class border backgr. text indicator child_border
client.focused $pink $pink $pink $pink $pink
@ -186,7 +187,8 @@ client.background $blue
# Removes border and title bar
for_window [class="^.*"] border pixel 4
#new_window 1pixel
new_float normal 4
#new_float normal 4
default_floating_border normal 4
#new_window normal 0 px
# Screenshots

View File

@ -0,0 +1,7 @@
#!/bin/bash
# Stop all waybar instances
killall -q waybar
while pgrep -x waybar >/dev/null; do sleep 0.1; done
waybar &

View File

@ -18,7 +18,8 @@ files=($dotdir/.zprofile ~/ 'n'
$dotdir/polybar ~/.config/ 'n'
$dotdir/rofi ~/.config/ 'n'
$dotdir/scripts ~/.config/ 'n'
$dotdir/systemd ~/.config/ 'n')
$dotdir/systemd ~/.config/ 'n'
$dotdir/waybar ~/.config/ 'n')
# arg parser
for arg in "$@"

104
waybar/config Normal file
View File

@ -0,0 +1,104 @@
{
"layer": "top",
"output": ["DVI-D-0", "LVDS-1"],
"position": "top",
"height": 35, // Waybar height (to be removed for auto height)
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["pulseaudio", "network", "backlight", "battery", "tray", "clock"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{icon}",
"format-icons": {
"1": "1",
"2": "",
"3": "3",
"4": "4",
"5": "5",
"urgent": "",
"focused": "",
"default": ""
}
},
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{icon} {name}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"interval": 1,
"format": "{:%I:%M}",
"format-alt": "{:%Y-%m-%d %I:%M:%S}",
"tooltip": false
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
"format-critical": "{icon} {temperatureC}°C",
"format": "{icon} {temperatureC}°C",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{icon} {percent}%",
"format-icons": [""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{icon} {time}",
"format-good": "", // An empty format will hide the module
"format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{icon} {essid}",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"format-icons": [""]
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}% {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": "{format_source}",
"format-source": " {volume}%",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "qjackctl"
}
}

193
waybar/style.css Normal file
View File

@ -0,0 +1,193 @@
* {
border: none;
border-radius: 0;
/* `otf-font-awesome` is required to be installed for icons */
font-family: SF Pro Display, Helvetica, Arial, sans-serif;
font-size: 18px;
min-height: 0;
}
window#waybar {
background-color: rgba(0, 0, 0, 0.5);
border-bottom: 3px solid rgba(0, 0, 0, 0.5);
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
background-color: #000000;
}
window#waybar.empty {
background-color: #000000;
}
window#waybar.solo {
background-color: #000000;
}
/* Empyty Space */
window#waybar.termite {
background-color: #000000;
border-bottom: 3px solid rgba(0, 0, 0, 0.5);
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #ffffff;
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
box-shadow: inset 0 -3px #B3E5FC;
}
#workspaces button.focused {
background-color: #0288D1;
box-shadow: inset 0 -3px #B3E5FC;
}
#workspaces button.urgent {
background-color: #E91E63;
}
#mode {
background-color: #000000;
border-bottom: 3px solid #B3E5FC;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
margin: 0 4px;
color: #FFFFFF;
background-color: #0288D1;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0px;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 5px;
}
#clock {
background-color: #0288D1;
}
#battery {
background-color: #ffffff;
color: #000000;
}
#battery.charging, #battery.plugged {
color: #ffffff;
background-color: #2980b9;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #E91E63;
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;
}
#cpu {
background-color: #2980b9;
color: #000000;
}
#memory {
background-color: #2980b9;
}
#disk {
background-color: #2980b9;
}
#backlight {
background-color: #2980b9;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #E91E63;
}
#pulseaudio {
background-color: #0288D1;
color: #FFFFFF;
}
#pulseaudio.muted {
background-color: #FFFFFF;
color: #000000;
}
#tray {
background-color: #0288D1;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #E91E63;
}
#idle_inhibitor {
background-color: #000000;
}
#idle_inhibitor.activated {
background-color: #FFFFFF;
color: #000000;
}