Tuesday, November 21, 2023

Using Wayland instead of X11 on Linux

      Wayland is the future communication protocol between a display server and its clients on Linux.  In simple terms, it's what allows applications to be shown, moved, resized, closed, etc.   Wayland replaces the aging and less maintained X11 with more modern technologies designed for computing methods today rather than 40 years ago.  It has been in development since 2008, although just now getting more widely used, mainly due to Nvidia gpu's not working well in the past. 

    I have tried using it several times but could only get it working reasonable well using Gnome or KDE environments since I have a Nvidia gpu.  It would also work using Weston, a compositor made by the wayland folks, but lack of hotkey support and virtual desktops, elimated this option.  Since I dont like using full desktop environments, the only other choice for wayland is a compositor that uses wlroots, which is a modular Wayland compositor library.   There are several compositors based on wlroots with the most popular being "sway" a i3 tiling window manager clone.  I tried out sway and river, and found them both working better than in the past but still a bit glitchy with graphics on Nvidia.  

     This brought me back to gnome and kde, could I use them without the full desktops?  I tried using the compositor of gnome without gnome-shell called "mutter".   Mutter did work fine with Nvidia but there wasn't any way to turn off the crazy desktop animations using dconf-editor.   So then I turned to kde, using "kwin" instead of the KDE plasma desktop.  

     Kwin works great, no glitches, no crazy animations, the hotkeys and virtual desktops work also.  There were three initial issues I ran into:  1. X11 apps would not load  2. Applications started very slow due to no notification daemon  3.  No desktop background.

     I solved issue 1 and 2 by installing "dunst" and starting kwin with the following command line:  "kwin_wayland --xwayland dunst"    This starts kwin with xwayland support for X11 apps and then loads dunst a notification daemon.   Issue 3 is still unresolved as kwin doesn't support a desktop background without plasma, but since I usually have a solid or black backgound it doesnt bother me.  

     Running kwin standalone seems to be the best solution for me for using wayland with a Nvidia gpu.   Nvidia support is getting better and I think eventually it will work great with wlroots.  For now, I'm enjoying using the future of linux while making my system work more like in the past :)

 


Sunday, July 30, 2023

Setting up my Pi-hole on Google wifi and configuring it as a dhcp server

 I recently changed over to Google fiber internet from using Comcast cable internet.  The city had installed Google fiber cable in the street of our neighborhood and having used fiber optic internet in the past, I was excited to change over to it.  Its a dedicated 1Gbps download and upload at a reasonable cost with an added 1TB google virtual drive to upload files to.  The installation into my home was not optimal but eventually they did it right with some complaining.  It comes with two google wifi mesh routers, and I decided to buy a third for better full house coverage.  The google mesh routers are very easy to setup and configure using a phone. However easy doesn't always mean good as I found out when trying to change advance network settings to configure my pi-hole into my new network. Since there is no way to connect directly into the google wifi routers there were several times my phone would just have a spinning wheel and I couldn't change anything and would require a hard reset and completely resetting all 3 routers to get it talking again. Much harder than a traditional router, However in the end I got everything working properly and even changed the dhcp server to use my pi-hole rather than the router.

Instead of writing all the steps it takes, I will summarize of what is needed to change in the google mesh wifi router to get it all working.  It basically takes setting up 3 things, they are:

1.  DHCP IP Reservations:   This has to be turned on with cloud services and the device and IP of your pi-hole needs to be added.

2.  LAN Settings:   Since there is no way to turn off DHCP in google wifi, the only way to use DHCP inside the pi-hole is to set the Start IP range and End IP range to the IP of your pi-hole.  Both will be the same IP.

3.  DNS Settings:   Set up a custom DNS setting to the IP address of your pi-hole.

Note: Google wifi uses 192.168.86.1 gateway by default rather than 192.168.1.1 like most routers so keep that in mind while configuring ip addresses.  If you do something wrong it may require deleting your network configuration, manually factory resetting each google mesh wifi router and then starting over to set up your network like a new installation.   This is where the google wifi falls way short of a traditional router system.  Simple if you don't want to ever configure much but harder when doing advanced networking.

After configuring Google wifi routers and rebooting network log into pi-hole to configure it as a DHCP server just access Settings > DHCP > Click DHCP Server Enabled checkbox.   Configure the range of addresses that you want other devices to use on your network and your router gateway address and then click Save at bottom of page.

That's it in summary, in reality it was a pain to setup but working well with full house ad blocking, recursive DNS, and DHCP from pi-hole computer rather than from the router.  Lots of benefits to each of these things some of which I have posted about previously. 

Overall, I'm happy with the results but sometimes wish I could just accept defaults like most do as it would be less work, it just bugs me when I can't configure things how I really want them.