gvolpe / blog-comments

Principled Software Craftsmanship (source moved permanently to https://github.com/gvolpe/gvolpe.github.io)
https://gvolpe.com/blog/
MIT License
2 stars 1 forks source link

[Comments] - XMonad + Polybar on NixOS #10

Open gvolpe opened 3 years ago

jkimmerling commented 3 years ago

Let me preface this by saying: I love how your setup looks!

I am having issues with the installer. I have done it twice and both times after I login on the lightdm page I am left with an empty desk top and "blueman" errors.

Xmonad never starts and I really dont know where to go from there.

You say install it on a fresh install, do this mean when I am still on the live cd, or right after i reboot after the initial install?

gvolpe commented 3 years ago

@jkimmerling glad you like it :)

I never tried it on a Live CD but it should work if properly configured. There are quite a few moving parts, make sure that XMonad is enabled at the system level and at the user level, if using Home Manager.

My setup is still pretty much the same but there have been a lot of tweaks since I wrote this blog post. Have a look at my latest config: https://github.com/gvolpe/nix-config

If you have your configuration published somewhere, I can probably give it a look and see if I notice something missing.

jkimmerling commented 3 years ago

Thanks, I will try to upload it to github. I am curious if i just did it incorrectly or left something out.

I followed the short steps listed on your github. My steps: I used the plasma live boot cd for the intstall environment I installed a minimal nixos using xfce and networkmanager, nothing fancy in the configuration.nix I rebooted into the xfce environment that was installed I followed these steps

mkdir DELETE_ME && cd DELETE_ME
nix-shell --run \
  "wget -c https://github.com/gvolpe/nix-config/archive/master.tar.gz && tar --strip-components=1 -xvf master.tar.gz" \
  -p wget s-tar
chmod +x install.sh && ./install.sh

Then when i reboot, I come to a lightdm login screen, I login, I get a fatal blueman execution error, and the whole desktop is empty, and the background is still the default blue mouse xfce background. There are no windows, menus, etc.

I am very new to Nixos, so I might not be doing something correctly.

Is there something else I have to do besides your listed steps? Should I use a different base DE?

gvolpe commented 3 years ago

I wouldn't trust that script. It's been a while since I've run a fresh installation, it might be outdated. Also, the full thing would only work for me since I manage secrets that need to be decoded with git-crypt.

The Nix configuration, on the other hand, it's up to date. Have a look at your ~/.config/nixpkgs/home.nix and /etc/nixos/configuration.nix. The former is the Home Manager configuration, the latter the system configuration.

Make sure you have the right channels.

As user:

$ nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz

As root:

# nix-channel --list
nixos https://nixos.org/channels/nixos-unstable

Run home-manager switch one more time, run whatever commands HM suggests and restart your system.

jkimmerling commented 3 years ago

Ah hah! Thanks I will try that

jkimmerling commented 3 years ago

I seemingly got it all setup BUT polybar is not showing up. Is it supposed to load automatically? Or is there something I have to do to make it load?

gvolpe commented 3 years ago

Check its status. If you copied my config verbatim that's probably not going to work for you, some config actually depends on the connected display. Run this command and you should see something similar when it works.

$ systemctl --user status polybar.service
● polybar.service - Polybar status bar
     Loaded: loaded (/nix/store/xfqxw24104nkwb6im8xvv5fck2lvlyxw-home-manager-files/.config/systemd/user/polybar.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-03-13 15:43:11 CET; 5 days ago
      Tasks: 32 (limit: 4915)
     Memory: 46.2M
        CPU: 41min 19.807s
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/polybar.service
             ├─7635 polybar top
             ├─7636 polybar bottom
             └─9900 /nix/store/h43bh88gxfw9b8ylclaqdp3d9ymbzpk5-xmonad-log-0.1.0/bin/xmonad-log

Mar 13 15:43:11 tongfang-amd systemd[1701]: Starting Polybar status bar...
Mar 13 15:43:11 tongfang-amd polybar-start[7614]: Running polybar on HDMI-A-0
Mar 13 15:43:11 tongfang-amd polybar-start[7614]: Network interfaces eno1 &
Mar 13 15:43:11 tongfang-amd systemd[1701]: Started Polybar status bar.

You should also check the logs (top.log and bottom.log).

$ tail -f .config/polybar/logs/top.log

That is, if you forward Polybar's output to the respective log files.

polybar top 2>${config.xdg.configHome}/polybar/logs/top.log & disown
polybar bottom 2>${config.xdg.configHome}/polybar/logs/bottom.log & disown
jkimmerling commented 3 years ago

Awesome, thanks a ton for the help!

On Fri, Mar 19, 2021 at 5:30 AM Gabriel Volpe @.***> wrote:

Check its status. If you copied my config verbatim that's probably not going to work for you, some config actually depends on the connected display. Run this command and you should see something similar when it works.

$ systemctl --user status polybar.service

● polybar.service - Polybar status bar

 Loaded: loaded (/nix/store/xfqxw24104nkwb6im8xvv5fck2lvlyxw-home-manager-files/.config/systemd/user/polybar.service; enabled; vendor preset: enabled)

 Active: active (running) since Sat 2021-03-13 15:43:11 CET; 5 days ago

  Tasks: 32 (limit: 4915)

 Memory: 46.2M

    CPU: 41min 19.807s

 CGroup: ***@***.***/app.slice/polybar.service

         ├─7635 polybar top

         ├─7636 polybar bottom

         └─9900 /nix/store/h43bh88gxfw9b8ylclaqdp3d9ymbzpk5-xmonad-log-0.1.0/bin/xmonad-log

Mar 13 15:43:11 tongfang-amd systemd[1701]: Starting Polybar status bar...

Mar 13 15:43:11 tongfang-amd polybar-start[7614]: Running polybar on HDMI-A-0

Mar 13 15:43:11 tongfang-amd polybar-start[7614]: Network interfaces eno1 &

Mar 13 15:43:11 tongfang-amd systemd[1701]: Started Polybar status bar.

You should also check the logs (top.log and bottom.log).

$ tail -f .config/polybar/logs/top.log

That is, if you forward Polybar's output to the respective log files.

polybar top 2>${config.xdg.configHome}/polybar/logs/top.log & disown

polybar bottom 2>${config.xdg.configHome}/polybar/logs/bottom.log & disown

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://protect-us.mimecast.com/s/8xOHCv2xEotWW3RQYhQO45d?domain=github.com, or unsubscribe https://protect-us.mimecast.com/s/X7kRCwpyGmCLLW2BqiqJnou?domain=github.com .

jthulhu commented 3 years ago

This article is very nice, as it provides a working and beautiful setup "out-of-the-box", that one can tweak (as opposed to the numerous tutorials that focus on a small aspect of a WM setup, making it painful to reach a "stable" state).

However, even though I followed it carefully (even though my setup is different on certain aspects), polybar does not seem to be working as expected. I currently face two annoying bugs, that I feel I should not face if I did properly follow the article, but I can't tell where I'm wrong.

The first one (definitively the most annoying) is that each bar is considered by XMonad as normal windows. So, when I start my session, I have two windows that split my screen in two, the top and bottom bars (which therefore only render half of the bar). If, say, I also start firefox, the bars pile up as if I had three open programs. I did not have this problem when I tried xmobar.

The second problem is that I get the following log when running polybar:

notice: Loaded font "Iosevka Nerd Font:style=Medium:size=16" (name=Iosevka, offset=3, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/truetype/NerdFonts/Iosevka Medium Nerd Font Complete.ttf)
notice: Loaded font "Iosevka Nerd Font:style=Medium:size=18" (name=Iosevka, offset=3, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/truetype/NerdFonts/Iosevka Medium Nerd Font Complete.ttf)
notice: Loaded font "Font Awesome 5 Free:style=Medium:size=40" (name=Font Awesome 5 Free, offset=3, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/opentype/Font Awesome 5 Free-Regular-400.otf)
notice: Loaded font "Iosevka Nerd Font:style=Medium:size=28" (name=Iosevka, offset=3, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/truetype/NerdFonts/Iosevka Medium Nerd Font Complete.ttf)
notice: Loaded font "Iosevka Nerd Font:style=Medium:size=7" (name=Iosevka, offset=3, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/truetype/NerdFonts/Iosevka Medium Nerd Font Complete.ttf)
notice: Loaded font "Material Design Icons:size=18" (name=Material Design Icons, offset=0, file=/nix/store/wsdhg2q2m2i23j4wzvpmmikqfaaawvfk-home-manager-path/share/fonts/truetype/materialdesignicons-webfont.ttf)
warn: Dropping unmatched character  (U+e9de) in ' 39°C '
warn: Dropping unmatched character  (U+e927) in ' Tue 26 Oct 2021  06:37:03 PM '
warn: Dropping unmatched character  (U+e939) in ' Tue 26 Oct 2021  06:37:03 PM '
warn: Dropping unmatched character  (U+e91c) in '     30% (02:35:00) '
warn: Dropping unmatched character  (U+e9de) in ' 40°C '
warn: Dropping unmatched character  (U+e927) in ' Tue 26 Oct 2021  06:37:04 PM '
warn: Dropping unmatched character  (U+e939) in ' Tue 26 Oct 2021  06:37:04 PM '
warn: Dropping unmatched character  (U+e91c) in '     30% (02:35:00) '
[...]

the warnings repeat until I kill polybar. I think this is a font issue, which is why I included the loaded fonts, but even trying to include supposedly complete fonts (from Nerd Fonts), it still drops the characters.

Just to be clear, all the special unicode characters I have used come from your configuration files.

I don't really know how to patch it, since I just recently switched from a DE, and never had this kind of problems (until a few days ago, I had never installed a font, and didn't even really care about it...). Any idea?

etrigan63 commented 2 years ago

Forked this project to adapt to my own system. I have some questions: What do you mean by a "minimal system"? How minimal does it have to be? Does this require an entire DE be pre-installed? I kind of prefer a streamlined install with one tiling window environment. Any steps on how to do this if the script is no longer valid? I will be testing on a VM first and then on a laptop once I get the hang of it.