Restructure waybar config

Move module and common layout config into separate files to be imported
Use different monitor bar setup for dual screens
This commit is contained in:
Evie Litherland-Smith 2023-05-02 15:25:23 +01:00
parent 08a6789735
commit b123eab5aa
11 changed files with 194 additions and 77 deletions

View file

@ -10,8 +10,8 @@ exec-once = waybar -c ~/.config/waybar/config-hyprland
exec-once = eww daemon
# Source a file (multi-file configs)
source = ~/.config/hypr/keybinds.conf
source = ~/.config/hypr/window-rules.conf
source = ./keybinds.conf
source = ./window-rules.conf
# Some default env vars.
env = XCURSOR_SIZE,24

View file

@ -65,7 +65,6 @@ bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
bind = $mainMod, period, workspace, m+1
bind = $mainMod, comma, workspace, m-1

View file

@ -1,6 +1,7 @@
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrule = float, ^(thunar)$
windowrule = float, ^(pavucontrol)$
windowrule = float, ^(Signal)$
windowrule = center, ^(pavucontrol)$
windowrule = float, ^(.blueman-manager-wrapped)$
windowrule = center, ^(.blueman-manager-wrapped)$
@ -11,22 +12,20 @@ windowrule = move 2% 6%, ^(otpclient)$
windowrule = float, title:^(Zoom)(.*)$
windowrule = center, title:^(Zoom)(.*)$
windowrulev2 = tile,class:^(Nxplayer.bin)$,title:^(NoMachine)(.*)$
windowrulev2 = float,class:^(Nxplayer.bin)$,title:^(NoMachine)$
windowrulev2 = center,class:^(Nxplayer.bin)$,title:^(NoMachine)$
windowrule = workspace 1, ^(neovide)$
windowrule = workspace 2, ^(firefox)$
windowrule = workspace 2, ^(librewolf)$
windowrule = workspace 2, ^(Chromium-browser)$
windowrule = workspace 3, ^(org.kde.dolphin)$
windowrule = workspace 4, ^(thunderbird)$
windowrule = workspace 4, ^(Mailspring)$
windowrule = workspace 4, ^(Microsoft Teams - Preview)$
windowrule = workspace 5, ^(Element)$
windowrule = workspace 5, ^(Signal)$
windowrule = workspace 5, ^(discord)$
windowrule = workspace 5, title:^(Zoom)(.*)$
windowrule = workspace 6, ^(Steam)$
windowrule = workspace 6, ^(steamwebhelper)$
windowrule = workspace 7, ^(Bitwarden)$
windowrule = workspace 8, ^(Nxplayer.bin)$
windowrule = monitor 1, ^(neovide)$
windowrule = workspace 2, ^(firefox|librewolf)$
windowrule = monitor 1, ^(firefox|librewolf)$
windowrule = workspace 3, ^(Microsoft Teams - Preview)$
windowrule = monitor 1, ^(Microsoft Teams - Preview)$
windowrule = workspace 3, ^(Element|Signal|discord)$
windowrule = workspace 3, title:^(Zoom)(.*)$
windowrule = monitor 1, title:^(Zoom)(.*)$
windowrule = monitor 1, ^(Steam)$
windowrule = monitor 1, ^(steamwebhelper)$
windowrule = workspace 4, ^(Nxplayer.bin)$
windowrule = monitor 1, ^(Nxplayer.bin)$

View file

@ -0,0 +1,4 @@
{
}
// vim: ft=json

View file

@ -1,6 +0,0 @@
{
"include": "~/.config/waybar/config-hyprland",
"output": "HDMI-A-1"
}
// vim: ft=json

View file

@ -0,0 +1,18 @@
[
{
"include": ["~/.config/waybar/modules.json", "~/.config/waybar/layout.json"],
"output": "HDMI-A-1",
"modules-left": ["custom/launcher", "cpu", "memory", "temperature"],
"modules-center": ["wlr/workspaces"],
"modules-right": ["pulseaudio", "network", "backlight", "clock", "tray", "custom/power"],
},
{
"include": ["~/.config/waybar/modules.json", "~/.config/waybar/layout.json"],
"output": "DP-1",
"modules-left": ["custom/launcher"],
"modules-center": ["wlr/workspaces"],
"modules-right": ["custom/power"]
}
]
// vim: ft=json

View file

@ -1,26 +0,0 @@
{
"include": "~/.config/waybar/config",
"modules-center": ["wlr/workspaces"],
// Modules configuration
"wlr/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"urgent": "",
"focused": "",
"default": ""
}
}
}
// vim: ft=json

View file

@ -1,27 +0,0 @@
{
"include": "./config",
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad"],
"modules-center": ["sway/window"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "󰊯",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"urgent": "",
"focused": "",
"default": ""
}
},
}
// vim: ft=json

View file

@ -0,0 +1,11 @@
{
"layer": "top",
"position": "top",
"spacing": 10,
"margin-top": 10,
"margin-left": 20,
"margin-right": 20,
"margin-bottom": 5,
}
// vim: ft=json

View file

@ -0,0 +1,145 @@
{
// Modules configuration
"custom/launcher":{
"format": "󰀻",
"on-click": "rofi -show drun"
},
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"timezone": "Europe/London",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}% 󰻠",
"tooltip": false
},
"memory": {
"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": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% 󰂄",
"format-plugged": "{capacity}% 󰚥",
"format-alt": "{time} {icon}",
"format-icons": ["󱃍", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
"format-wifi": "{essid} ({signalStrength}%) 󰖩",
"format-ethernet": "Connected 󰈁",
"tooltip-format": "{ifname}",
"format-linked": "{ifname} (No IP) 󰈁",
"format-disconnected": "Disconnected 󰈂",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"bluetooth": {
"format": "󰂯 {status}",
"format-disabled": "󰂲 {status}",
"format-off": "󰂲 {status}",
"format-on": "󰂯 {status}",
"format-connected": "󰂱 {device_alias}",
"on-click": "blueman-manager"
},
"pulseaudio": {
"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": "󰍭",
"format-icons": {
"headphone": "󰋋",
"hands-free": "󰥰",
"headset": "󰋎",
"phone": "󰏲",
"portable": "󰏳",
"car": "󰄍",
"default": ["󰕿", "󰖀", "󰕾"]
},
"on-click": "pavucontrol"
},
"custom/power":{
"format": "󰐥",
"on-click": "~/.dotfiles/scripts/powermenu"
},
"wlr/workspaces": {
"on-click": "activate",
"disable-scroll": true,
"all-outputs": false,
"sort-by-number": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"urgent": "",
"focused": "",
"default": ""
},
"persistent_workspaces": {
"1": [],
"2": [],
"3": [],
"4": []
}
},
"sway/workspaces": {
"on-click": "activate",
"disable-scroll": true,
"all-outputs": false,
"sort-by-number": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"urgent": "",
"focused": "",
"default": ""
},
"persistent_workspaces": {
"1": [],
"2": [],
"3": [],
"4": []
}
}
}
// vim: ft=json