Tagged: modules

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

FreeBSD 10: linux_base-f10-10_7 linuxulator is not (kld) loaded error

On the other day, I was trying to install Adobe Flash plugin support for opera by following the FreeBSD handbook. It says:

To install Adobe® Flash® plugin support, first compile the www/linux-f10-flashplugin11 port, as a package is not available due to licensing restrictions. Then install either the www/opera-linuxplugins port or package. This example compiles both applications from ports: # cd /usr/ports/www/linux-f10-flashplugin11 # make install clean # cd /usr/ports/www/opera-linuxplugins # make install clean

So I followed above example and typed make install clean for linux-f10-flashplugin11. Then I got below error: ... Linux_base-f10-10_7 linuxulator is not (kld)loaded. *** [install] Error code 1...

Huh? Being a FreeBSD novice, I got a bit confused because this chapter (7.2.2. Opera) in the handbook didn't mention anything about loading linux kernel module.

But a little googling came to rescue!

Apparently, I needed to load the linux.ko module before installing those ports (found out in chapter 11.2. Configuring Linux® Binary Compatibility):

To load the linux.ko module: # kldload linux

To verify: # kldstat Id Refs Address Size Name 1 11 0xffffffff80200000 15f0310 kernel 2 1 0xffffffff817f1000 20400 geom_eli.ko 3 2 0xffffffff81812000 34ed0 crypto.ko 4 1 0xffffffff81a12000 432d4 linux.ko

After this, compiling for linux-f10-flashplugin11 and opera-linuxplugins went smoothly.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb