rc

Add Waybar configuration files

Author
Maarten Vangeneugden
Date
Oct. 16, 2020, 2:43 p.m.
Hash
273b9ccf198214b75af13e0cc2767f91404303da
Parent
a864cd3b9c5df386ff63c38ed26ef8d01f616dc0
Modified files
waybar/config.json
waybar/style.css

waybar/config.json

156 additions and 0 deletions.

View changes Hide changes
+
1
// After the opening parentheses, you enter the Waybar "general config", which
+
2
// configures the overall bar itself.
+
3
// After that, you can give the name of a specific module, and open parentheses
+
4
// for that as well, which configures for that module specifically.
+
5
+
6
// NOTE: If I happen to get a weird feeling for music in the future, there are
+
7
// some fine things available for MPD.
+
8
+
9
{
+
10
    "layer": "top", // Waybar at top layer
+
11
    "position": "left", // Waybar position (top|bottom|left|right)
+
12
    //"height": 30, // Waybar height (to be removed for auto height)
+
13
    "width": 63, // Waybar width
+
14
    // Choose the order of the modules
+
15
    "modules-left": ["sway/workspaces", "sway/mode"],
+
16
    "modules-center": ["sway/window"],
+
17
    //"modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"],
+
18
    //"modules-right": ["pulseaudio#output", "pulseaudio#input", "cpu", "network",
+
19
    "modules-right": ["pulseaudio#output", "pulseaudio#input", "cpu",
+
20
    "memory", "temperature", "backlight", "battery", "battery#bat2", "clock#day", "clock#date", "clock#time", "tray"],
+
21
    // Modules configuration
+
22
    // NOTE: To maintain order; configure the modules in the same order as they
+
23
    // appear in the bar itself (i.e. modules-left -> modules-center ->
+
24
    // modules-right), so this stays tidy and maitainable.
+
25
+
26
    "sway/workspaces": {
+
27
        "disable-scroll-wraparound": true,
+
28
        "all-outputs": true,
+
29
        "format": "{name}  {icon}",
+
30
        "format-icons": {
+
31
            "1": "",
+
32
            "2": "",
+
33
            "3": "",
+
34
            "4": "",
+
35
            "5": "",
+
36
            "urgent": "",
+
37
            "focused": "",
+
38
            "default": ""
+
39
        }
+
40
    },
+
41
    "sway/mode": { // Sway/mode is for things like when resizing
+
42
        "format": "<span style=\"italic\">{}</span>"
+
43
    },
+
44
+
45
    "sway/window": {
+
46
        "rotate": 90
+
47
    },
+
48
    "pulseaudio#output": {
+
49
        "format": "{volume}% {icon}",
+
50
        "format-bluetooth": "{volume}% {icon} {format_source}",
+
51
        "format-muted": "",
+
52
        "format-icons": {
+
53
            "headphones": "",
+
54
            "handsfree": "",
+
55
            "headset": "",
+
56
            "phone": "",
+
57
            "portable": "",
+
58
            "car": "",
+
59
            "speaker": "",
+
60
            // The speaker icons don't show up...
+
61
            //""
+
62
            //"speaker": ["", "", ""],
+
63
            "hdmi": "H",
+
64
            "hifi": "F",
+
65
            "default": "S" //["", "", ""]
+
66
        },
+
67
        "on-click": "pavucontrol",
+
68
        "tooltip": false
+
69
    },
+
70
    
+
71
    "pulseaudio#input": {
+
72
        "format": "{format_source}",
+
73
        "format-source": "{volume}% ",
+
74
        "format-source-muted": "{volume}% ",
+
75
        "on-click": "pavucontrol",
+
76
        "tooltip": false
+
77
    },
+
78
+
79
    "cpu": {
+
80
        "format": "{usage}% ",
+
81
        "tooltip": false
+
82
    },
+
83
    "memory": {
+
84
        "format": "{}% "
+
85
    },
+
86
    "temperature": {
+
87
        // "thermal-zone": 2,
+
88
        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
+
89
        "critical-threshold": 80,
+
90
        // "format-critical": "{temperatureC}°C {icon}",
+
91
        "format": "{temperatureC}°C {icon}",
+
92
        "format-icons": ["", "", ""]
+
93
    },
+
94
    "backlight": {
+
95
        // "device": "acpi_video1",
+
96
        "format": "{percent}% {icon}",
+
97
        "format-icons": ["", ""]
+
98
    },
+
99
    "battery": {
+
100
        "states": {
+
101
            // "good": 95,
+
102
            "warning": 30,
+
103
            "critical": 15
+
104
        },
+
105
        "format": "{capacity}% {icon}",
+
106
        "format-charging": "{capacity}% ",
+
107
        "format-plugged": "{capacity}% ",
+
108
        "format-alt": "{time} {icon}",
+
109
        // "format-good": "", // An empty format will hide the module
+
110
        // "format-full": "",
+
111
        "format-icons": ["", "", "", "", ""]
+
112
    },
+
113
    "battery#bat2": {
+
114
        "bat": "BAT2"
+
115
    },
+
116
    //"network": {
+
117
        //// "interface": "wlp2*", // (Optional) To force the use of this interface
+
118
        //// The ESSID or IFname aren't shown because it's too long
+
119
        //"format-wifi": "{signalStrength}% ",
+
120
        //"format-ethernet": "{bandwidthDownBits} ",
+
121
        //"format-linked": "{bandwidthDownBits} ",
+
122
        //"format-disconnected": " ",
+
123
        //"format": "{bandwidthDownBits}",
+
124
        //"tooltip": false
+
125
    //},
+
126
    // The reason I'm using three clocks next to each other, is because if I use
+
127
    // %n in the format, the text doesn't align to the center anymore, which
+
128
    // looks ugly. And since I can't set text-align in the CSS, this is the
+
129
    // hack I came up with.
+
130
    "clock#day": {
+
131
        "tooltip": false,
+
132
        "interval": 3600,
+
133
        //"format": "{:%A <br /> %d/%m <br /> %H:%M}",
+
134
        //"format": "{:%a %n %d/%m %n %H:%M}"
+
135
        "format": "{:%a}"
+
136
        //"format": "{:%A}" // Did this previously but Wednesday was too long
+
137
        //"max-length": 50
+
138
        //"format-alt": "{:%Y-%m-%d}"
+
139
    },
+
140
    "clock#date": {
+
141
        "tooltip": false,
+
142
        "interval": 3600,
+
143
        "format": "{:%d %h}"
+
144
    },
+
145
    "clock#time": {
+
146
        "tooltip": false,
+
147
        "interval": 1,
+
148
        //"format": "{:%H:%M}"
+
149
        "format": "{:%H:%M:%S}"
+
150
    },
+
151
    "tray": {
+
152
        // "icon-size": 21,
+
153
        "spacing": 10
+
154
    }
+
155
}
+
156

waybar/style.css

152 additions and 0 deletions.

View changes Hide changes
+
1
* {
+
2
    border: none;
+
3
    border-radius: 0;
+
4
    font-family: Ubuntu, Roboto, Helvetica, Arial, sans-serif;
+
5
    font-size: 15px;
+
6
    min-height: 0;
+
7
}
+
8
+
9
+
10
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
+
11
/* sway/workspaces */
+
12
#workspaces button {
+
13
    padding: 0 2px;
+
14
    background: transparent;
+
15
    color: #ffffff;
+
16
    border-bottom: 3px solid transparent;
+
17
    transition-property: padding;
+
18
    transition-duration: .5s;
+
19
}
+
20
+
21
#workspaces button.focused {
+
22
    background: #64727D;
+
23
    border-bottom: 3px solid #ffffff;
+
24
    padding: 5px;
+
25
}
+
26
+
27
#workspaces button.urgent {
+
28
    background-color: #eb4d4b;
+
29
}
+
30
+
31
window#waybar {
+
32
    background: rgba(43, 48, 59, 0.5);
+
33
    border-bottom: 3px solid rgba(100, 114, 125, 0.5);
+
34
    color: #ffffff;
+
35
    transition-property: background, background-color;
+
36
    transition-duration: .5s;
+
37
}
+
38
+
39
window#waybar.hidden {
+
40
    opacity: 0.2;
+
41
}
+
42
+
43
/*
+
44
window#waybar.empty {
+
45
    background: transparent;
+
46
}
+
47
window#waybar.solo {
+
48
    background: #FFFFFF;
+
49
}
+
50
*/
+
51
+
52
window#waybar.termite {
+
53
    background-color: #3F3F3F;
+
54
}
+
55
+
56
window#waybar.chromium {
+
57
    background-color: #000000;
+
58
    border: none;
+
59
}
+
60
+
61
+
62
#mode {
+
63
    background: #64727D;
+
64
    border-bottom: 3px solid #ffffff;
+
65
}
+
66
+
67
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network,
+
68
#pulseaudio, #tray, #mode {
+
69
    /*padding: 0 10px;
+
70
    margin: 0 5px;*/
+
71
    color: #ffffff;
+
72
}
+
73
+
74
#clock {
+
75
    background-color: #64727D;
+
76
}
+
77
+
78
#battery {
+
79
    background-color: #ffffff;
+
80
    color: #000000;
+
81
}
+
82
+
83
#battery.charging {
+
84
    color: #ffffff;
+
85
    background-color: #26A65B;
+
86
}
+
87
+
88
@keyframes blink {
+
89
    to {
+
90
        background-color: #ffffff;
+
91
        color: #000000;
+
92
    }
+
93
}
+
94
+
95
#battery.critical:not(.charging) {
+
96
    background: #f53c3c;
+
97
    color: #ffffff;
+
98
    animation-name: blink;
+
99
    animation-duration: 0.5s;
+
100
    animation-timing-function: linear;
+
101
    animation-iteration-count: infinite;
+
102
    animation-direction: alternate;
+
103
}
+
104
+
105
label:focus {
+
106
    background-color: #000000;
+
107
}
+
108
+
109
#cpu {
+
110
    background: #2ecc71;
+
111
    color: #000000;
+
112
}
+
113
+
114
#memory {
+
115
    background: #9b59b6;
+
116
}
+
117
+
118
#backlight {
+
119
    background: #90b1b1;
+
120
}
+
121
+
122
#network {
+
123
    background: #2980b9;
+
124
}
+
125
+
126
#network.disconnected {
+
127
    background: #f53c3c;
+
128
}
+
129
+
130
#pulseaudio {
+
131
    background: #f1c40f;
+
132
    color: #000000;
+
133
}
+
134
+
135
#pulseaudio.muted {
+
136
    background: #90b1b1;
+
137
    color: #2a5c45;
+
138
}
+
139
+
140
#temperature {
+
141
    background: #f0932b;
+
142
}
+
143
+
144
#temperature.critical {
+
145
    background: #eb4d4b;
+
146
}
+
147
+
148
#tray {
+
149
    background-color: #2980b9;
+
150
}
+
151
+
152