From 129684571bdee5e615129662d26f6c8c98d51d88 Mon Sep 17 00:00:00 2001
From: blint <blintmester@sch.bme.hu>
Date: Sun, 13 Sep 2020 20:39:23 +0200
Subject: [PATCH] update

---
 .config/sway/config      |   4 +-
 .config/waybar/config    | 160 ++++++++++++++++++++++++++---------
 .config/waybar/style.css | 178 ++++++++++++++++++++++++++++-----------
 3 files changed, 253 insertions(+), 89 deletions(-)

diff --git a/.config/sway/config b/.config/sway/config
index 595362c..a7d2690 100644
--- a/.config/sway/config
+++ b/.config/sway/config
@@ -204,7 +204,7 @@ bindsym $mod+r mode "resize"
 #    }
 #}
 
-exec waybar
+exec bash -c "sleep 5; waybar"
 
 include /etc/sway/config.d/*
 
@@ -254,7 +254,7 @@ assign [class="Mattermost"] workspace 9
 for_window [class="Spotify"] move workspace 8
 assign [title="autostart — Konsole"] workspace 2
 
-exec nm-applet --indicator
+exec bash -c "sleep 10; nm-applet --indicator"
 exec telegram-desktop
 exec flatpak run com.mattermost.Desktop
 #exec spotify
diff --git a/.config/waybar/config b/.config/waybar/config
index a5064f7..5b795e0 100644
--- a/.config/waybar/config
+++ b/.config/waybar/config
@@ -1,58 +1,142 @@
 {
-    "layer": "top", // Waybar at top layer
-    "modules-left": ["sway/workspaces"],
-    "modules-right": ["cpu", "memory", "backlight", "network", "pulseaudio", "battery", "tray", "clock"],
+    // "layer": "top", // Waybar at top layer
+    // "position": "bottom", // Waybar position (top|bottom|left|right)		
+    //"height": 45, // Waybar height (to be removed for auto height)
+    // "width": 1260, // Waybar width
+    // Choose the order of the modules
+    "modules-left": ["sway/workspaces", "sway/mode", "custom/media", "sway/window"],
+    "modules-center": [],
+    "modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory",  "backlight", "battery", "battery#bat2", "clock", "tray"],
+    // Modules configuration
+     "sway/workspaces": {
+         "disable-scroll": false,
+         "all-outputs": true,
+         "format": "{name}: {icon}",
+         "format-icons": {
+             "1": "",
+             "2": "",
+             "8": "",
+             "9": "",
+             "urgent": "",
+             "focused": "",
+             "default": ""
+         }
+     },
+    "sway/mode": {
+        "format": "<span style=\"italic\">{}</span>"
+    },
+    "mpd": {
+        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
+        "format-disconnected": "Disconnected ",
+        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
+        "unknown-tag": "N/A",
+        "interval": 2,
+        "consume-icons": {
+            "on": " "
+        },
+        "random-icons": {
+            "off": "<span color=\"#f53c3c\"></span> ",
+            "on": " "
+        },
+        "repeat-icons": {
+            "on": " "
+        },
+        "single-icons": {
+            "on": "1 "
+        },
+        "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
+         "icon-size": 21,
+         "spacing": 10
     },
     "clock": {
-        "tooltip-format": "{:%Y-%m-%d | %H:%M}",
-        "format-alt": "{:%Y-%m-%d}",
-        "format": "{:%a %Y-%m-%d %H:%M %p}"
+        "format": "{:%H:%M}",
+        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
+        "format-alt": "{:%Y-%m-%d}"
     },
     "cpu": {
-        "format": " {usage}%"
+        "format": "{usage}% ",
+        "tooltip": true
     },
     "memory": {
-        "format": " {}%"
+        "format": "{}% "
+    },
+    "temperature": {
+        // "thermal-zone": 2,
+        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
+        "critical-threshold": 80,
+        // "format-critical": "{temperatureC}°C {icon}",
+        "format": "{temperatureC}°C {icon}",
+        "format-icons": ["", "", ""]
     },
     "backlight": {
-        //"device": "intel_backlight",
-        "format": " {percent}%",
-        "format-icons": ["", ""]
+    "interval": 5,
+    "format": "{icon}",
+    "format-alt": "{percent}% {icon}",
+    "format-alt-click": "click",
+    "format-icons": ["🌕", "🌔", "🌓", "🌒", "🌑"],
+    "on-scroll-down": "brightnessctl -c backlight set 5%-",
+    "on-scroll-up": "brightnessctl -c backlight set +5%"
     },
     "battery": {
-        //"states": {
-        //    // "good": 95,
-        //    "warning": 30,
-        //    "critical": 15
-        //},
-        "format": " {capacity}%"
+        "states": {
+             "good": 95,
+            "warning": 30,
+            "critical": 15
+        },
+        "format": "{capacity}% {icon}",
+        "format-charging": "{capacity}% ",
+        "format-plugged": "{capacity}% ",
+        "format-alt": "{time} {icon}",
         // "format-good": "", // An empty format will hide the module
         // "format-full": "",
-        //"format-icons": ["", "", "", "", ""]
+        "format-icons": ["", "", "", "", ""]
+    },
+    "battery#bat2": {
+        "bat": "BAT2"
     },
     "network": {
-        // "interface": "wlp2s0", // (Optional) To force the use of this interface
-        "format-wifi": " {signalStrength}% ({ipaddr})",
-        "format-ethernet": "{ifname}: {ipaddr}/{cidr} ethernet",
-        "format-disconnected": "⚠"
+        // "interface": "wlp2*", // (Optional) To force the use of this interface
+        "format-wifi": "{ipaddr}/{cidr} {essid} ({signalStrength}%) ",
+        "format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
+        "format-linked": "{ifname} (No IP) ",
+        "format-disconnected": "Disconnected ⚠",
+        //"format-alt": "{ip6addr}/{cidr} {essid} ({signalStrength}%) " //get ipv6 addr
     },
     "pulseaudio": {
-        //"scroll-step": 1,
-        "format": " {volume}%",
-        "format-bluetooth": "{volume}% {icon}",
-        "format-muted": "",
-        "format-icons": {
-            "headphones": "",
-            "handsfree": "",
-            "headset": "",
-            "phone": "",
-            "portable": "",
-            "car": "",
-            "default": ["", ""]
-        },
-        "on-click": "pavucontrol"
+        "scroll-step": 2, // %, 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": "",
+        "on-click": "pavucontrol",
+        "format-icons": ["🔈", "🔉", "🔊"]
+    },
+    "custom/media": {
+       "exec": "playerctl status"
+    
+    },
+    "wlr/taskbar": {
+    	"format": "{icon}",
+   	    "icon-size": 15,
+   	    "icon-theme": "Numix-Circle",
+        "tooltip-format": "{title}",
+    	"on-click": "activate",
+    	"on-click-middle": "close"
     }
 }
diff --git a/.config/waybar/style.css b/.config/waybar/style.css
index 802accb..0ccae74 100644
--- a/.config/waybar/style.css
+++ b/.config/waybar/style.css
@@ -1,70 +1,113 @@
-* {
+	* {
+	margin-left: 1px;
     border: none;
     border-radius: 0;
-    /*font-family: "Hack", "Noto Color Emoji", sans-serif;*/
-    font-size: 18px;
-    /*font-weight: bold;*/
-    min-height: 0;
+    /* `otf-font-awesome` is required to be installed for icons */
+    font-family: Google Sans Medium, San Francisco Text,Roboto, Helvetica, Arial, sans-serif;
+    font-size: 12pt;
 }
 
 window#waybar {
-    background: #000000;
+    background-color: rgba(43, 48, 59, 0.0);
     /*border-bottom: 3px solid rgba(100, 114, 125, 0.5);*/
-    color: #e5e9f0;
+    color: #ffffff;
+    transition-property: background-color;
+    transition-duration: .5s;
+}transition
+
+window#waybar.hidden {
+    opacity: 0.2;
 }
 
-/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
+	
 #workspaces button {
-    padding: 0 5px;
-    background: transparent;
+	/* padding-left: 3px; */
+	/* padding-right: 3px; */
+	/* padding-top: 3px; */
+	
+	border-radius: 5px;
+    background-color: #4b5162;
     color: #ffffff;
-    border-bottom: 3px solid transparent;
+    font-size: 15pt;
+    /* border-bottom: 3px solid transparent; */
+}
+
+#window {
+	font-size: 15pt;
+	margin-left: 10px;
+}
+
+/* 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: inherit;
+   /*  border-bottom: 3px solid #ffffff; */
 }
 
 #workspaces button.focused {
-    background: #4c566a;
-    border-bottom: 3px solid #e5e9f0;
+    background-color: #5294e2;
+    border: 1px solid #ffffff;
 }
 
 #workspaces button.urgent {
-    background-color: #bf616a;
+    background-color: #eb4d4b;
 }
 
 #mode {
-    background: #64727D;
+    background-color: #64727D;
     border-bottom: 3px solid #ffffff;
 }
 
-#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor {
-    padding: 0 10px;
-    margin: 0 5px;
+#clock,
+#battery,
+#cpu,
+#memory,
+#temperature,
+#backlight,
+#network,
+#pulseaudio,
+#custom-media,
+#tray,
+#mode,
+#idle_inhibitor,
+#mpd {
+    
+    margin: 0 4px;
+    color: #ffffff;
+    font-size: 15pt;
+    border-radius: 15px;
+    
 }
 
 #clock {
-    /*background-color: #64727D;*/
-    color: #e5e9f0;
+	border: 5px solid transparent;
+    background-color: #64727D;
+    border-radius: 15px;
     font-weight: bold;
+    font-size: 15pt;
 }
 
 #battery {
-    /*background-color: #000000;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #CDCDCD;
+    color: #000000;
+    /*border-radius: 15px;*/
 }
 
 #battery.charging {
-    /*background-color: #000000;*/
-    color: #e5e9f0;
+    color: #ffffff;
+    background-color: #26A65B;
 }
 
 @keyframes blink {
     to {
-        /*background-color: #ffffff;*/
+        background-color: #ffffff;
         color: #000000;
     }
 }
 
 #battery.critical:not(.charging) {
-    background: #f53c3c;
+    background-color: #f53c3c;
     color: #ffffff;
     animation-name: blink;
     animation-duration: 0.5s;
@@ -73,72 +116,109 @@ window#waybar {
     animation-direction: alternate;
 }
 
+label:focus {
+    background-color: #000000;
+}
+
 #cpu {
-    /*background: #2ecc71;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #404552;
+    /*border-radius: 15px; */
+    /*color: #000000;*/
 }
 
 #memory {
-    /*background: #9b59b6;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #4b5162;
+    border-radius: 15px;
 }
 
 #backlight {
-    /*background: #90b1b1;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #CDCDCD;
+    /*border-radius: 15px;*/
 }
 
 #network {
-    /*background: #2980b9;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #4b5162;
+    /*border-radius: 15px;*/
 }
 
 #network.disconnected {
-    /*background: #f53c3c;*/
-    color: #e5e9f0;
+    background-color: #f53c3c;
 }
 
 #pulseaudio {
-    /*background: #000000;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #7c818c;
+    /*color: #000000;*/
+    /*border-radius: 15px;*/
 }
 
 #pulseaudio.muted {
-    /*background: #000000;*/
-    color: #e5e9f0;
+    background-color: #b1b190;
+    color: #2a5c45;
 }
 
 #custom-media {
-    background: #66cc99;
+	border: 3px solid transparent;
+    background-color: #66cc99;
     color: #2a5c45;
+    min-width: 100px;
 }
 
-.custom-spotify {
-    background: #66cc99;
+#custom-media.custom-spotify {
+    background-color: #66cc99;
+    /*border-radius: 10px;*/
 }
 
-.custom-vlc {
-    background: #ffa000;
+#custom-media.custom-vlc {
+    background-color: #ffa000;
 }
 
 #temperature {
-    background: #f0932b;
+	border: 10px solid transparent;
+    background-color: #7c818c;
+	/*border-radius: 15px;*/
 }
 
 #temperature.critical {
-    background: #eb4d4b;
+    background-color: #eb4d4b;
 }
 
 #tray {
-    /*background-color: #2980b9;*/
-    color: #e5e9f0;
+	border: 10px solid transparent;
+    background-color: #4b5162;
+    /*border-radius: 15px;*/
 }
 
 #idle_inhibitor {
+	border: 10px solid transparent;
     background-color: #2d3436;
+    /*border-radius: 15px;*/
 }
 
 #idle_inhibitor.activated {
     background-color: #ecf0f1;
     color: #2d3436;
 }
+
+#mpd {
+	border: 10px solid transparent;
+    background-color: #66cc99;
+    color: #2a5c45;
+   /*border-radius: 15px;*/
+}
+
+#mpd.disconnected {
+    background-color: #f53c3c;
+}
+
+#mpd.stopped {
+    background-color: #90b1b1;
+}
+
+#mpd.paused {
+    background-color: #51a37a;
+}
-- 
GitLab