summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-04-16 23:41:32 +0200
committerLeah (ctucx) <leah@ctu.cx>2021-04-16 23:41:32 +0200
commit7a81e81b0f93094831b2d9be63ae2837ac61aefa (patch)
treede52a10434912483310d5bc7b63b3dae8409c4b4
parentf20987fbcc26451982b25139c6a62dcb3544348d (diff)
downloaddotfiles-7a81e81b0f93094831b2d9be63ae2837ac61aefa.tar.gz
dotfiles-7a81e81b0f93094831b2d9be63ae2837ac61aefa.tar.bz2
dotfiles-7a81e81b0f93094831b2d9be63ae2837ac61aefa.zip
.config/waybar: update style, add powermenu, weather
-rw-r--r--private_dot_config/waybar/config219
-rw-r--r--private_dot_config/waybar/scripts/executable_poweroff.sh27
-rw-r--r--private_dot_config/waybar/scripts/executable_weather.sh7
-rw-r--r--private_dot_config/waybar/style.css149
4 files changed, 250 insertions, 152 deletions
diff --git a/private_dot_config/waybar/config b/private_dot_config/waybar/config
index 13500c4..c9bd5af 100644
--- a/private_dot_config/waybar/config
+++ b/private_dot_config/waybar/config
@@ -1,90 +1,131 @@
-{
- "battery": {
- "bat": "BAT0",
- "format": "{icon} {capacity}% {time}",
- "format-charging": "{icon}  {capacity}%",
- "format-icons": [
- "",
- "",
- "",
- "",
- ""
- ],
- "interval": 10,
- "states": {
- "critical": 20,
- "warning": 30
+[
+ {
+ "name": "topbar",
+ "layer": "top",
+ "position": "top",
+ "height": 40,
+ "modules-left": ["sway/workspaces", "sway/mode"],
+ "modules-center": ["clock"],
+ "modules-right": ["tray", "disk", "memory", "cpu", "battery#bat1", "battery#bat2", "idle_inhibitor", "network#wifi", "pulseaudio", "custom/mail", "custom/weather", "custom/poweroff"],
+ "sway/window": {
+ "format": "{} ",
+ "on-click": "swaymsg kill"
+ },
+ "idle_inhibitor": {
+ "format": "{icon}",
+ "format-icons": {
+ "activated": "",
+ "deactivated": ""
+ }
+ },
+ "clock": {
+ "interval": 1,
+ "format": "<b>{:%H:%M:%S}</b>",
+ "format-alt": "{:%Y-%m-%d}",
+ "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
+ },
+ "cpu": {
+ "format": " {usage}%",
+ "tooltip": false
+ },
+ "disk": {
+ "format": " {}%",
+ "tooltip-format": "{used} / {total} used"
+ },
+ "memory": {
+ "format": " {}%",
+ "tooltip-format": "{used:0.1f}G / {total:0.1f}G used"
+ },
+ "battery#bat1": {
+ "bat": "BAT0",
+ "adapter": "AC",
+ "interval": 10,
+ "full-at": 99,
+ "states": {
+ "full": 100,
+ "good": 99,
+ "warning": 30,
+ "critical": 15
+ },
+ "format": "{icon} {capacity}%",
+ "format-charging": " {capacity}%",
+ "format-plugged": " {capacity}%",
+ "format-empty": "",
+ "format-full": "",
+ "format-icons": ["", "", "", "", ""]
+ },
+ "battery#bat2": {
+ "bat": "BAT1",
+ "adapter": "AC",
+ "interval": 10,
+ "states": {
+ "full": 100,
+ "good": 99,
+ "critical": 15
+ },
+ "format": "{icon} {capacity}%",
+ "format-charging": " {capacity}%",
+ "format-plugged": " {capacity}%",
+ "format-full": "",
+ "format-icons": ["", "", "", "", ""]
+ },
+ "network#ethernet": {
+ "interface": "enp*",
+ "format-ethernet": "",
+ "format-linked": "",
+ "format-disconnected": "",
+ "tooltip-format": "{ifname}: {ipaddr}/{cidr}",
+ "on-click": "nm-connection-editor"
+ },
+ "network#wifi": {
+ "interface": "wlan0*",
+ "format-ethernet": "",
+ "format-wifi": " {essid} ({signalStrength}%)",
+ "format-linked": "",
+ "format-disconnected": "",
+ "tooltip-format": "{ifname}: {ipaddr}/{cidr}",
+ "on-click": "nm-connection-editor"
+ },
+ "pulseaudio": {
+ "scroll-step": 1,
+ "format": "{format_source} {icon} {volume}%",
+ "format-bluetooth": "{format_source} {icon} {volume}%",
+ "format-bluetooth-muted": "{format_source}  {icon}",
+ "format-muted": "{format_source} ",
+ "format-source": "",
+ "format-source-muted": "",
+ "format-icons": {
+ "headphone": "",
+ "phone": "",
+ "portable": "",
+ "car": "",
+ "default": ["", "", ""]
+ },
+ "on-click": "pavucontrol"
+ },
+ "custom/weather": {
+ "return-type": "json",
+ "exec": "bash $HOME/.config/waybar/scripts/weather.sh",
+ "interval": 300,
+ "on-click": "firefox https://wttr.in"
+ },
+ "custom/poweroff": {
+ "tooltip": false,
+ "format": "",
+ "on-click": "bash $HOME/.config/waybar/scripts/poweroff.sh"
+ },
+ "custom/mail": {
+ "tooltip": false,
+ "exec": "sh $HOME/.config/waybar/scripts/mail.sh",
+ "interval": 120,
+ "on-click": "thunderbird && swaymsg '[app_id=thunderbird] focus'"
+ },
+ "tray": {
+ "icon-size": 13,
+ "spacing": 10
+ },
+ "sway/mode": {
+ "format": "<span style=\"italic\">{}</span>"
+ }
}
- },
- "battery#2": {
- "bat": "BAT1"
- },
- "clock": {
- "format": "{:%H:%M}",
- "interval": 60,
- "tooltip": false
- },
- "cpu": {
- "format": " {}%"
- },
- "height": 30,
- "layer": "top",
- "memory": {
- "format": " {}%"
- },
- "modules-center": [
- "clock"
- ],
- "modules-left": [
- "sway/workspaces",
- "sway/mode",
- "sway/window"
- ],
- "modules-right": [
- "tray",
- "battery",
- "battery#2",
- "network",
- "pulseaudio",
- "cpu",
- "memory"
- ],
- "position": "top",
- "pulseaudio": {
- "format": "{icon} {volume}%",
- "format-icons": [
- "",
- ""
- ],
- "format-muted": "",
- "on-click": "pavucontrol"
- },
- "sway/mode": {
- "format": "<span weight=\"bold\">{}</span>",
- "tooltip": false
- },
- "sway/window": {
- "tooltip": false
- },
- "sway/workspaces": {
- "all-outputs": true,
- "disable-scroll": true
- },
- "temperature": {
- "critical-threshold": 90,
- "format": "{icon} {temperatureC}°C",
- "format-icons": [
- "",
- "",
- "",
- "",
- ""
- ],
- "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
- "interval": 1
- },
- "tray": {
- "spacing": 10,
- "tooltip": false
- }
-}
+]
diff --git a/private_dot_config/waybar/scripts/executable_poweroff.sh b/private_dot_config/waybar/scripts/executable_poweroff.sh
new file mode 100644
index 0000000..fa891bd
--- /dev/null
+++ b/private_dot_config/waybar/scripts/executable_poweroff.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+case $(wofi -d -L 6 -l 3 -W 100 -x -100 -y 10 \
+ -D dynamic_lines=true << EOF | sed 's/^ *//'
+ Shutdown
+ Reboot
+ Log off
+ Sleep
+ Lock
+ Cancel
+EOF
+) in
+ "Shutdown")
+ systemctl poweroff
+ ;;
+ "Reboot")
+ systemctl reboot
+ ;;
+ "Sleep")
+ systemctl suspend
+ ;;
+ "Lock")
+ loginctl lock-session
+ ;;
+ "Log off")
+ swaymsg exit
+ ;;
+esac
diff --git a/private_dot_config/waybar/scripts/executable_weather.sh b/private_dot_config/waybar/scripts/executable_weather.sh
new file mode 100644
index 0000000..f5fe83a
--- /dev/null
+++ b/private_dot_config/waybar/scripts/executable_weather.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+text="$(curl -s 'https://wttr.in/?format=1')"
+tooltip="$(curl -s 'https://wttr.in?0QT' |
+ sed 's/\\/\\\\/g' |
+ sed ':a;N;$!ba;s/\n/\\n/g' |
+ sed 's/"/\\"/g')"
+echo "{\"text\": \"$text\", \"tooltip\": \"<tt>$tooltip</tt>\", \"class\": \"weather\"}"
diff --git a/private_dot_config/waybar/style.css b/private_dot_config/waybar/style.css
index 3bff5d3..53ff2bd 100644
--- a/private_dot_config/waybar/style.css
+++ b/private_dot_config/waybar/style.css
@@ -1,106 +1,129 @@
+@define-color base00 #181818;
+@define-color base01 #282828;
+@define-color base02 #383838;
+@define-color base03 #585858;
+@define-color base04 #b8b8b8;
+@define-color base05 #d8d8d8;
+@define-color base06 #e8e8e8;
+@define-color base07 #f8f8f8;
+@define-color base08 #ab4642;
+@define-color base09 #dc9656;
+@define-color base0A #f7ca88;
+@define-color base0B #a1b56c;
+@define-color base0C #86c1b9;
+@define-color base0D #7cafc2;
+@define-color base0E #ba8baf;
+@define-color base0F #a16946;
+
+@keyframes blink {
+ to {
+ background-color: @base02;
+ color: black;
+ }
+}
+
* {
border: none;
border-radius: 0;
- font-family: "Roboto Mono", "Material Design Icons";
- font-size: 16px;
+ font-family: monospace;
+ font-size: 14px;
min-height: 0;
+ transition: none;
+ box-shadow: none;
}
window#waybar {
- background-color: rgba(11, 11, 11, 0.8);
- color: #ffffff;
- transition-property: background-color;
- transition-duration: .5s;
+ background: @base01;
+ color: white;
}
-window#waybar.hidden {
- opacity: 0.2;
-}
-#window {
- padding: 0 15px;
+#workspaces {
+ background-color: @base02;
+ margin: 5px 0px 5px 0px;
}
-/*
-window#waybar.empty {
- background-color: transparent;
+#workspaces:last-child {
+ border-radius: 0px 5px 5px 0px;
}
-window#waybar.solo {
- background-color: #FFFFFF;
+
+#workspaces button:nth-last-child(1) {
+ border-radius: 0px 5px 5px 0px;
}
-*/
-/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button {
- padding: 0 5px;
- background-color: transparent;
- border-bottom: 2px solid rgba(100, 114, 125, 0.5);
- color: #999999;
+ padding: 0 10px;
+ color: #eceff4;
}
#workspaces button.focused {
- color: #ffffff;
- background-color: #333333;
- border-bottom: 2px solid #00ff96;
+ color: #2e3440;
+ background-color: @base0D;
}
-#workspaces button.urgent {
- background-color: #eb4d4b;
+#workspaces button:hover {
+ background-color: @base03;
+}
+
+
+#custom-weather, #disk, #memory, #cpu, #idle_inhibitor, #clock, #battery, #pulseaudio, #network {
+ background-color: @base02;
+ padding: 0px 10px;
+ margin: 5px 0px;
}
-#clock,
-#battery,
-#cpu,
-#memory,
-#backlight,
-#network,
-#pulseaudio,
-#tray,
-#mode,
#idle_inhibitor {
- padding: 0 5px;
- margin: 0 4px;
- background-color: transparent;
- border-bottom: 2px solid #00ff96;
- color: #ffffff;
+ margin-right: 10px;
+ border-radius: 0px 5px 5px 0px;
}
-#mode {
- background-color: #00ff96;
- color: #000000;
+#custom-poweroff {
+ color: #2e3440;
+ background-color: #bf616a;
+ border-radius: 5px 0px 0px 5px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ margin-left: 0px;
+ padding: 0px 10px;
}
-#pulseaudio,
-#tray,
-#cpu,
-#idle_inhibitor {
- border-bottom: transparent;
+#clock {
+ color: #b48ead;
+ border-radius: 5px;
}
-#battery {
- border-bottom: 2px solid #bff874;
+#custom-weather {
+ margin-right: 10px;
+ border-radius: 0px 5px 5px 0px;
}
-#battery.charging {
- border-bottom: 2px solid #00ff96;
+#network {
+ color: #d08770;
+ border-radius: 5px 0px 0px 5px;
}
-#battery.critical:not(.charging) {
- border-bottom: 2px solid #dd2241;
+#disk {
+ border-radius: 5px 0px 0px 5px;
}
-label:focus {
- background-color: #000000;
+#pulseaudio {
+ color: #ebcb8b;
}
-#network.disconnected {
- border-bottom: 2px solid #dd2241;
+#battery {
+ color: #a3be8c;
}
-#pulseaudio.bluetooth {
- border-bottom: 2px solid #1a8cff;
+#battery.charging {
+ color: #a3be8c;
}
-#pulseaudio.muted {
- border-bottom: 2px solid #fff569;
+#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;
}