Create usable Sway config

This commit is contained in:
2020-03-06 00:29:24 +01:00
parent 35ba2dd3ad
commit a088278bd0
5 changed files with 545 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
{
"layer": "top", // Waybar at top layer
"height": 20, // Waybar height (to be removed for auto height)
"modules-left": ["sway/workspaces"],
"modules-center": ["clock"],
"modules-right": ["mpd", "network", "custom/alsa", "battery"],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"mpd": {
"format": "<span foreground='#88C0D0'>{stateIcon}</span>{title}",
"format-disconnected": "",
"format-stopped": "{stateIcon} ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%a %d %b %H:%M}",
"format-alt": "{:%Y-%m-%d}"
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "<span foreground='#88C0D0'>{icon}</span>{capacity}%",
"format-charging": "<span foreground='#88C0D0'></span>{capacity}%",
"format-plugged": "<span foreground='#88C0D0'></span>{capacity}%",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "<span foreground='#88C0D0'>{icon}</span>{essid}",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}",
"format-icons": ["", "", ""]
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {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": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/alsa": {
"exec": "amixer get Master | sed -nre 's/.*\\[off\\].*/muted/p; s/.*\\[(.*%)\\].*/\\1/p'",
"signal": 11,
"interval": 10,
"tooltip": false
}
}

View File

@@ -0,0 +1,166 @@
* {
border: none;
border-radius: 0;
/* `otf-font-awesome` is required to be installed for icons */
font-family: lime, Siji;
font-size: 10px;
min-height: 0px;
}
window#waybar {
background-color: #211B29;
color: #D8DEE9;
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 {
}
window#waybar.chromium {
}
*/
#workspaces button {
padding: 0 5px;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
}
#workspaces button.focused {
color: #88C0D0;
}
#workspaces button.urgent {
color: #88C0D0;
}
#mode {
color: #88C0D0;
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
margin: 0 4px;
color: #ffffff;
}
#clock {
}
#battery {
}
#battery.charging {
color: #ffffff;
}
@keyframes blink {
to {
color: #000000;
}
}
#battery.critical:not(.charging) {
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
}
#cpu {
}
#memory {
}
#backlight {
}
#network {
}
#network.disconnected {
}
#pulseaudio {
color: #D8DEE9;
}
#pulseaudio.muted {
color: #D8DEE9;
}
#custom-media {
color: #D8DEE9;
min-width: 100px;
}
#custom-media.custom-spotify {
}
#custom-media.custom-vlc {
}
#temperature {
}
#temperature.critical {
}
#tray {
}
#idle_inhibitor {
}
#idle_inhibitor.activated {
color: #D8DEE9;
}
#mpd {
color: #D8DEE9;
}
#mpd.disconnected {
}
#mpd.stopped {
}
#mpd.paused {
}