Tagged: my_thoughts

Displaying Desktop Notification w/ cron

Gentoo Linux needs to run a set of scheduled maintenance commands to keep the system up-to-date. I try to run them weekly, but I sometimes (or often) forget to do so. To remind myself, I decided to display some kind of system notification. Gentoo Linux comes with a command for that. It's called notify-send. This command can be configured to run weekly with cron (with a bit of extra commands and arguments). After playing with different options, following setting with cron finally worked for me.

Disclaimer:
The information in this site is the result of my researches on the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

# crontab -e # This command runds at 7am on Fridays 00 7 * * 5 export DISPLAY=:0.0 && export XAUTHORITY=/home/[user-name]/.Xauthority && /usr/bin/notify-send -t 0 'Maintenance' 'Run the maintenance commands'

Without the -t 0 option, the notification disappears within a certain time. This option will let the notification stays up until it's clicked.

Step for Maintaining Gentoo Server

That's all!
-gibb

Getting Sound Working From VirtualBox Clients

I got the sound working on my new system (Dell Precision 3640 Tower) with Gentoo after following the steps in Getting Sound (ALSA) Working on Gentoo. However, I couldn't get through from any of VirtualBox clients (Window$10, Manjaro Linux, or Ubuntu)

Some advices on the internet were to change the settings for Host Audio Driver and Audio Controller options on the VirtualBox host side. I tried all combination but couldn't get it working.

Disclaimer:
The information in this site is the result of my researches on the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

PulseAudio:

PulseAudio is a general purpose sound server intended to run as a middleware between applications and ALSA. I never needed to install PulseAudio to get the sound working before, so I followed the Gentoo Wiki: PulseAudio.

Kernel Update & Installation:

The Gentoo Wiki: PulseAudio shows which kernel options to turn on using make menuconfig and recompiling the kernel. # cd /usr/src/linux # make menuconfig # make && make modules_install ... # make install ... # grub-mkconfig -o /boot/grub/grub.cfg ...

After rebooting, make sure that the kernel version is updated by uname -r:# uname-v #5 SMP Fri Duc 18 14:46:23 EST 2020

Then, install pulseaudio:# emerge --ask media-sound/pulse

USE flags:

Once pulseaudio is installed, enable the system to support pulseaudio for some applications by updating /etc/portage/make.conf:

FILE /etc/portage/make.conf
USE="... pulseaudio ..."

Then update the system:# emerge --ask --changed-use --deep @world

ALSA Plugin:

ALSA needs to be configured to output to PulseAudio by default:# emerge --ask media-plugins/alsa-plugins

After following the above steps, the next time VirtualBox is started, the sound should be enabled from a client OS.

That's all!
-gibb

Updated: Python Modules

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Python Modules for i3pystatus:

With a fresh install, I seem to have issues with properly starting i3pystatus in both my workstation and VirtualBox guest. The following statement to execute i3pystatus in the i3wm config file no longer seem to be working. So, after a lot of googling, I found a solution that worked for me:... bar { # Below statement used to work before but this now gives following error message: # Traceback (most recent call last): # File ".../pystatusconfig.py", line 1, in # from i3pystatus import Status # ModuleNotFoundError: No module name 'i3pystatus' # # status_command python3 -c ~/.config/i3/pystatusconfig.py # # But after switching to below statement, it runs without above error message. status_command i3pystatus -c ~/.config/i3/pystatusconfig.py ...

pyalsaaudio:

Then, I needed to install alsaaudio python module for the volume control to work in addition to aforementioned colour, netifaces, and psutil: $ pip install --user colour \ netifaces \ psutil \ pyalsaaudio

CpuUsage: TypeError:

After above issues have been taken care of, and restarting i3pystatus, another error pops up. This time, it was something about a format issue for CpuUsage. The exact error message was this "CpuUsage: TypeError: format() missing 1 required positional argument: 'format_string'". I stumbled upon this one before and couldn't figure out even after googling. I copied the same statements as others but still got the error. Then I learned that there was an issue opened for this or something similar in enkore/i3pystatus. According to this thread, there is a fix for it and applied to the source code, but mine didn't get that fix for some reasons. So, I manually fixed it.

The target file is ~/.local/lib/python3.8/site-packages/i3pystatus/cpu_usage.py. In this file, at line 88, a string "format_string=" needs to be removed. ... # At the line 88, the "format_string=" string needs to be removed. # string = self.formatter.format(format_string=self.format_all, string = self.formatter.format(self.format_all, ...

That's all!
-gibb

Updated: NVIDIA Drivers

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

NVIDIA Drivers:

The new video card installed on DELL Precision 3640 Tower is Nvidia Quadro P620, and the driver for this card is included in x11-drivers/nvidia-drivers. So, no need to download drivers from the NVIDIA website. Just run and follow the instruction of post installation at Gentoo Wiki: NVIDIA/nvidia-drivers : # emerge --ask x11-drivers/nvidia-drivers

That's all!
-gibb

Updated: .Xresources for urxvt

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

.Xresources for urxvt:

After starting urxvt, if it looks like .Xresources isn't loaded, one thing we can make sure is to see if all specified fonts are installed and loaded in the system. fontconfig is one tool to check which font config files are enabled for the system.

To list installed font config files: # eselect fontconfig list ============================ Available fontconfig .conf files (* is enabled): [1] 10-autohint.conf * [2] 10-no-sub-pixel.conf [3] 10-sub-pixel-bgr.conf [4] 10-sub-pixel-rgb.conf [5] 10-sub-pixel-vbgr.conf [6] 10-sub-pixel-vrgb.conf [7] 10-unhinted.conf [8] 11-lcdfilter-default.conf [9] 11-lcdfilter-legacy.conf ...

To enable a font config file: # eselect fontconfig enable 10-sub-pixel-rgb.conf # eselect fontconfig enable 4

See if above step allows urxvt to successfully load .Xresources.

That's all!
-gibb