From 5eda03d28c99273e5fd7b7cefce0b48a15888df0 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Wed, 15 Jul 2020 11:37:21 +0200 Subject: [PATCH] Add waybar. --- Makefile | 2 +- config/sway/config.m4 | 43 ++++++++++------- config/waybar/config | 101 ++++++++++++++++++++++++++++++++++++++++ config/waybar/style.css | 84 +++++++++++++++++++++++++++++++++ config/wofi/style.css | 2 +- 5 files changed, 213 insertions(+), 19 deletions(-) create mode 100644 config/waybar/config create mode 100644 config/waybar/style.css diff --git a/Makefile b/Makefile index b3c6a13..21822e7 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ FILES = bashrc bash_profile vimrc zshrc gitconfig screenrc commonshrc liquidprom config/khal config/vdirsyncer/config config/khard \ config/rofi-pass gdbinit notmuch-config \ config/fish tridactylrc config/sway/config config/mpv/mpv.conf \ - config/wofi \ + config/wofi config/waybar \ $(wildcard sbt/0.13/*.sbt sbt/0.13/plugins/*.sbt) \ $(wildcard sbt/1.0/plugins/*.sbt) diff --git a/config/sway/config.m4 b/config/sway/config.m4 index 539ecc0..36df148 100644 --- a/config/sway/config.m4 +++ b/config/sway/config.m4 @@ -121,25 +121,30 @@ client.focused_inactive base02 base02 base03 base01 client.unfocused base01 base01 base03 base01 client.urgent base02 base08 base07 base08 +bar { + swaybar_command waybar +} + # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) -bar { - status_command i3status - font pango:DejaVu Sans, Noto Sans CJK JP 9 - icon_theme Adwaita - - tray_output * - - colors { - separator base03 - background base01 - statusline base05 - focused_workspace base0C base0D base00 - active_workspace base02 base02 base07 - inactive_workspace base01 base01 base03 - urgent_workspace base08 base08 base07 - } -} +# bar { +# swaybar_command waybar +# status_command i3status +# font pango:DejaVu Sans, Noto Sans CJK JP 11 +# icon_theme Adwaita +# +# tray_output * +# +# colors { +# separator base03 +# background base01 +# statusline base05 +# focused_workspace base0C base0D base00 +# active_workspace base02 base02 base07 +# inactive_workspace base01 base01 base03 +# urgent_workspace base08 base08 base07 +# } +# } exec --no-startup-id mako exec --no-startup-id gsd-xsettings @@ -180,6 +185,10 @@ ifelse(hostname, [decoysnail], [ # exec --no-startup-id ~/.screenlayout/desk.sh ]) +ifelse(hostname, [petalius], [ + output eDP-1 pos 0 0 res 2560x1440 scale 1 +]) + # pdfpc assign [[window_role="presenter"]] 1 assign [[window_role="presentation"]] 9 diff --git a/config/waybar/config b/config/waybar/config new file mode 100644 index 0000000..64cf3df --- /dev/null +++ b/config/waybar/config @@ -0,0 +1,101 @@ +// vim:ft=javascript: +{ + "layer": "top", + "position": "top", + "height": 30, + "modules-left": ["sway/workspaces", "sway/mode", "sway/window"], + "modules-center": ["clock"], + "modules-right": ["tray", "disk", "idle_inhibitor", "pulseaudio", "network", "battery"], + + "sway/workspaces": { + "persistent_workspaces": { + "1": [], + "2": [], + "3": [], + "4": [] + }, + "format-default": "{name}", + "format": "{icon}", + "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "" + //"urgent": "", + //"focused": "", + //"default": "" + }, + "disable-scroll": true, + "all-outputs": false + }, + + "sway/window": { + "format": "{}", + "max-length": 60, + "tooltip": false + }, + + "tray": { + "icon-size": 20, + "spacing": 10 + }, + + "clock": { + "tooltip": false, + "locale": "ja_JP.UTF-8", + "format": "{:%Y年%m月%d日 (%a) %H:%M}" + }, + + "disk": { + "format": "{free}" + }, + + "battery": { + "bat": "BAT0", + "states": { + "full": 100, + "good": 95, + "warning": 30, + "critical": 15 + }, + "interval": 60, + "format": "{capacity}% {icon}", + // "format": "{capacity}% {time} {icon}", + "format-time": "{H}:{M:02}", + //"format-good": "", // An empty format will hide the module + //"format-full": "", + "format-icons": ["", "", "", "", ""] + }, + + "network": { + // "interface": "wlp2s0", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength:02}%) ", + "format-ethernet": "{ifname} ", + "format-disconnected": "", //An empty format will hide the module. + "tooltip-format-wifi": "{essid} {ipaddr} ({signalStrength}%) " + }, + + "pulseaudio": { + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% {icon}", + "format-muted": "", + "on-click": "pavucontrol", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", ""] + } + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + } +} diff --git a/config/waybar/style.css b/config/waybar/style.css new file mode 100644 index 0000000..9e57a83 --- /dev/null +++ b/config/waybar/style.css @@ -0,0 +1,84 @@ +* { + border: none; + border-radius: 0; + /* font-family: monospace; */ + font-family: "Noto Sans Mono CJK JP"; + font-size: 15px; + min-height: 0; +} + +window#waybar{ + background: #222; + color: white; +} + +#window { +} + +#workspaces button { + padding: 0 15px; + color: white; +} + +#workspaces button.focused { + color: black; + background: #bbb; +} + +#mode { +} + +#clock, #battery, #cpu, #memory, #network, #pulseaudio, #idle_inhibitor, #tray, +#workspaces, #window, #disk { + padding: 0px 12px; + margin: 0 3px; +} + +#clock { +} + +#battery.full { + /* color: LimeGreen; */ +} + +#battery.charging:not(.full) { + /* color: LimeGreen; */ +} + +#battery.warning:not(.charging) { + color: DarkOrange; +} + +#battery.critical:not(.charging) { + color: Tomato; +} + +#cpu { +} + +#memory { +} + +#network { +} + +#network.disconnected { +} + +#pulseaudio { +} + +#pulseaudio.muted { +} + +#tray { +} + +#idle_inhibitor { + min-width: 2em; +} +#idle_inhibitor.activated { + color: black; + background: Orange; +} + diff --git a/config/wofi/style.css b/config/wofi/style.css index fed57a7..c6b5e31 100644 --- a/config/wofi/style.css +++ b/config/wofi/style.css @@ -3,7 +3,7 @@ window { border: 1px solid #666; background-color: #222; color: white; - font-family: "Fira Code"; + font-family: "Fira Mono"; } #input {