From ea22f2a0273aaf1d799060aec22b46c34c8dac5d Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sat, 28 Oct 2023 23:12:12 +0200 Subject: [PATCH] Adjust DPI, fix incorrect default variables usage in Polybar --- .Xresources.laptop | 8 ++++++++ .config/polybar/config.d/above | 0 .config/polybar/config.d/desk | 5 ++++- .config/polybar/config.d/laptop | 7 +++++-- .config/polybar/config_common | 18 +++++++++--------- README.md | 8 +++++--- 6 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 .Xresources.laptop create mode 100644 .config/polybar/config.d/above diff --git a/.Xresources.laptop b/.Xresources.laptop new file mode 100644 index 0000000..63a0029 --- /dev/null +++ b/.Xresources.laptop @@ -0,0 +1,8 @@ +Xft.dpi: 110 +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintfull +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb + diff --git a/.config/polybar/config.d/above b/.config/polybar/config.d/above new file mode 100644 index 0000000..e69de29 diff --git a/.config/polybar/config.d/desk b/.config/polybar/config.d/desk index b9e08aa..053b956 100644 --- a/.config/polybar/config.d/desk +++ b/.config/polybar/config.d/desk @@ -3,4 +3,7 @@ dpi = 90 height = 27 top_left = powermenu system-uptime-pretty player-mpris top_center = xwindow -top_right = system-usb-udev alsa date \ No newline at end of file +top_right = system-usb-udev alsa date +bottom_left = i3 +bottom_center = wired-network wireless-network updates-arch-combined +bottom_right = temperature cpu memory filesystem-custom diff --git a/.config/polybar/config.d/laptop b/.config/polybar/config.d/laptop index 4899733..43797c1 100644 --- a/.config/polybar/config.d/laptop +++ b/.config/polybar/config.d/laptop @@ -1,6 +1,9 @@ [variables] -dpi = 110 -height = 70 +dpi = 100 +height = 35 top_left = powermenu system-uptime-pretty battery player-mpris top_center = xwindow top_right = system-usb-udev backlight pulseaudio date +bottom_left = i3 +bottom_center = wireless-network updates-arch-combined +bottom_right = temperature cpu memory filesystem-custom diff --git a/.config/polybar/config_common b/.config/polybar/config_common index a48348a..5655393 100644 --- a/.config/polybar/config_common +++ b/.config/polybar/config_common @@ -13,9 +13,9 @@ margin-top=50 ; Common to top and bottom bars [bar/common] width = 100% -dpi = ${variables.dpi:90} +dpi = ${variables.dpi} enable-ipc = true -height = ${variables.height:30} +height = ${variables.height} foreground = ${colors.foreground} background = ${colors.background} line-size = 3 @@ -42,9 +42,9 @@ padding-right = 10 module-margin-left = 4 module-margin-right = 4 -modules-left = ${variables.top_left:powermenu system-uptime-pretty player-mpris} -modules-center = ${variables.top_center:xwindow} -modules-right = ${variables.top_right:system-usb-udev alsa date} +modules-left = ${variables.top_left} +modules-center = ${variables.top_center} +modules-right = ${variables.top_right} tray-position = right @@ -70,9 +70,9 @@ font-2 = Symbola:size=5;1 font-3 = MaterialIcons-Regular:size=11;4 font-4 = Font Awesome 5 Free:style=solid:size=10;2 -modules-left = i3 -;modules-center = -modules-right = wired-network wireless-network updates-arch-combined temperature cpu memory filesystem-custom +modules-left = ${variables.bottom_left} +modules-center = ${variables.bottom_center} +modules-right = ${variables.bottom_right} [module/player-mpris] type = custom/script @@ -335,4 +335,4 @@ ramp-volume-2 = 🔊 ramp-headphones-0 =  ramp-headphones-1 =  -interval = 3 \ No newline at end of file +interval = 3 diff --git a/README.md b/README.md index 77abc64..800972f 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ However, depending on your machine you may want slightly different modules loade This can be done in `~/.config/polybar/conf.d/` (see [explanation for env](#managing-divergences-between-environments)). -This is optional for now as by default, polybar will use this fallback values : +If you want to test this setup, it will probably work with the `laptop` environnment. You can try these fallback values : ```ini [variables] -dpi = 90 -height = 27 +dpi = 110 +height = 40 top_left = powermenu system-uptime-pretty player-mpris top_center = xwindow top_right = system-usb-udev alsa date @@ -169,6 +169,8 @@ Other times, you have a base configuration for all environment with specific add In that case, the script will create a `/config` file, which contains the concatenation of `config_common` and `config.d/`, the later being optional. Filenames and path are hardcoded for now. +If an `above` file is found in `config.d`, the per-environment configuration will be prepended to the base configuration. This is useful for e.g. setting base variables. + ### Configuration outside XDG_CONFIG_HOME, e.g. /etc Some configuration files reside in `/etc` directory, but I want to keep track of them.