Stand With Ukraine
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, April 2, 2025

Setting up a screen lock with i3 on lightdm

As you might know there are many basic things, which are done automatically for you by GNOME and KDE, you have to do with i3 window manager yourself. One such thing is the screen locking functionality. If you are using lightdm login manager then there is a nice way to make it in the following manner:

# install the light locker (for arch-based distros)
yay light-locker
  
# add the following lines to your ~/.config/i3/config
exec_always --no-startup-id /usr/bin/light-locker
bindsym $mod+l exec --no-startup-id light-locker-command --lock
The last line is needed to be able to lock the screen with $mod+l combination. My $mod=Win, so I get to lock my screen with Win+l.

What I like about this approach is that it brings you to the lightdm login window, which is how I expected the locking to behave before I started using i3.

Sunday, December 15, 2024

i3 (EndeavouOS edition): Multiple keyboard layouts

Here I will show you how to add a ukrainian keyboard layout to an existing layout (in this case us), so you can type using different languages.
  • First add the following to your ~/.config/i3/config file:
    # add layouts
    exec setxkbmap -layout us,ua
    # set a switching shortcut
    exec setxkbmap -option 'grp:alt_shift_toggle'
    
  • Now we want to show the current layout in the system tray (this might be distribution dependent, I guess). EndeavourOS provides some ready scripts for which I needed to install dependencies and uncomment some lines in the ~/.config/i3/i3blocks.config.
    • Install dependencies
      yay xkblayout-state
      
    • Uncomment the following block in ~/.config/i3/i3blocks.config:
      [keyboard-layout]
      command=~/.config/i3/scripts/keyboard-layout
      interval=2
      
Here is the screenshot of the way my env looks right now.



Sunday, January 21, 2024

Making suspend work on an arch-flavoured linux

I have a custom installation of linux (EndeavourOS if you are curious) that I use with the i3 window manager. But whenever I was doing
systemctl suspend
it was going to suspend but then turned back on, without any error message... Recently, I've guessed that the reason for this was the missing swap file. If you find yourself in a similar situation there is a nice howto on the creation and activation of a swapfile on Linux: https://btrfs.readthedocs.io/en/latest/Swapfile.html

Wednesday, July 26, 2023

How to set a correct keyboard layout in i3 window manager

Recently I rediscovered for myself the i3 desktop environment, got tired of windows spread here and there, but I am using an Apple aluminum keyboard with french letters and numeric keypad (just used to it), and I just hated that the layout did not correspond to what is marked on the buttons out of the box. To try to find a solution I googled and tried many things. I eventually ended up using
localectl
to set the correct keyboard layout. So below are the steps which might help you out:

Friday, March 24, 2023

Fedora a fix for black screen after a system update

I have updated my Fedora instance recently and got a black screen, fortunately Ctrl+Alt+F2 worked and I had internet in that session. I actually was not sure what needed to be done and goocling did not help much, I did dnf search nvidia and decided to install the following
sudo dnf install kmod-nvidia
And after reboot I got my Gnome back and running. Hope this helps someone else like me...

Tuesday, November 8, 2022

Fedora with GNOME

I got tired of some bugs with Manjaro KDE (the most painful were frequent interruptions of wifi connection and problems with viber), so I decided to switch to Fedora using Gnome. I like it much better at this point:
  • Apple multilingual keyboard configured almost painlessly;
  • For the drop-down terminal I found tilda to be a good replacement for Yakuake.
I'll post more if I encounter other important issues. On the current machine I tried 3 OS and would rank my experience as follows: Kubuntu < Manjaro (KDE) < Fedora (GNOME). I hope to stay with Fedora until a major issue. I like it so much even considering installing it on my old macbooks. My son installed it on his low spec machine and it works nicely as well.
  • I find the GNOME-shell extension ddterm (https://extensions.gnome.org/extension/3780/ddterm/) to work much better than tilda.
  • For CS-GO under steam I had to enable Proton in steam settings, otherwise the game is too slow and sometimes won't start at all...
UPDATE: I tried installing Fedora 37 on Macbook Air 2011, and it did not go well.. Even live usb was hanging. Therefore I downloaded Fedora 36 and it kind of worked, then I upgraded to Fedora 37 and my kernel was updated to 6.* and it is so very buggy, the system became unstable and hard froze. I was googling how to fix it, tried reinstalling broadcom-wl, but nothing helped. I guess I could have downgraded the kernel to the last working version (I think it was 5.17 or so). But I could not take it anymore and decided to try OpenSUSE Leap and it works fine, the system is stable (some programs like neovim versions are old although). The kernel version on OpenSuse is 5.14, so I guess that is why it works... To get newer apps you could use OBI/opi (https://github.com/openSUSE/opi) on openSuse.

Friday, November 5, 2021

Random freezes with AMD Ryzen fix for Manjaro

I was having these random freezes, when only hard reboot could revive the system, in Kubuntu and tried googling a lot reading system logs, updated BIOS... Decided to switch to Manjaro hoping that they will go away by itself, but I started haing freezes again especially when I lock screen...

I found these instructions and applied them: https://archived.forum.manjaro.org/t/amd-ryzen-problems-and-fixes/55533

The instructions are very easy to follow, except I could not find the BIOS option mentioned there...

So far, the system is stable and did not freeze yet. There was a minor hiccup on return from locked state, but this time tty2 (ctrl+alt+f2) worked and I ran reboot from there..

I will keep an eye on it though and will update the post.

Updates
  • Had a freeze today (same day after I posted this) but not in the lock screen, when working with chrome. (05/11/2021)
  • 07/11/2021: Another freeze, I was watching a youtube video.
  • 24/11/2021: I finally found C-states and the idle option in BIOS, and after this I have not had any freezes yet...

Wednesday, September 1, 2021

Remapping keys on kubuntu (Apple aluminum keyboard, Canadian Multilingual/French layout)

I like Apple keyboards, they are very comfortable to work with. But I prefer Linux to Mac, so I just attach my Apple keyboard to my Linux machine and try to make it work.

This time It worked almost out of the box on Kubuntu 21.04, but I had the following two keys swapped: 'ù' and '/'. First, I tried to remap them using xmodmap and xev, and it worked but that messed up my Yakuake shortcut and it continued to reset it after each reboot... I tried to figure out why, but in the process I found this post, which pointed me to this utility Key Mapper (just download and double-click the .deb to install it). From there it is easy to remap the keys (IFF you have sudo rights on your computer):

The only downside of this approach is that you have to have sudo rights to use the program. You could try installing it in an alternative location with
dpkg -x key-mapper*.deb dest/directory/of/your/choice
But, I think it requires root privileges to apply the mapping, which is a bummer. Not sure if this is easy to fix or if it is on the developer's radar.

Tuesday, October 6, 2020

Kubuntu 20.04 CPU and Network history are not showing up in KSysGuard

When I saw this problem and started googling, the solution that helped others was to copy SystemLoad2.sgrd file from a system folder to
~/.local/share/ksysguard/
, but that did not help me...

But removing the file
~/.local/share/ksysguard/SystemLoad2.sgrd
and restarting KSysGuard solved the issue for me. Therefore this solution is here, hope someone will find it useful as well.

Sunday, March 15, 2020

Connecting Wifi from command line on ubuntu 19.04

Sometimes I end up in a situation when the desktop environment does not work... That happened recently, and I had to search again how to connect to wifi from the terminal. Below is what I did:
ifconfig # to see the interface, in my case it was wlp4s0
nmcli d connect wlp4s0 --ask # to connect to my saved wifi connection (it will ask for a password)

Monday, January 25, 2016

Manjaro with Deepin desktop environment

This is another motivation screenshot of a newly installed Linux on my old Thinkpad laptop. I like how it looks (you can easily transform the bottom panel to a dock).. And I have not encountered any serious or annoying bugs yet. Another thing I like is the availability of software, that I use, from the Arch User Repositories. I have installed Atom (atom-editor), Pycharm, etc. Everything seems to run fast and looks solid. It has also installed correct NVidia drivers without any problems and without the famous black screen after reboot. So in conclusion, if you are tired of usual desktop environments like GNOME, KDE, MATE or Cinnamon the Deepin might be a nice new thing to try. There is a Deepin Linux as well, but I have not used that so cannot say much about it.

One thing that might be wrong with my setup is the messed up desktop wallpaper after hibernate... I saw it happen only once and it went away after changing the wallpaper in the desktop settings. I'll comment later if it'll turn out again. I was also having trouble setting up the wifi connection at my University, but that was fixed by escaping the '\' in my identity with another '\'. I'll try to report this issue later..

Update: The problem with suspend is recurrent, but it does not happen with the open source nouveau graphics driver. So I'll stick to the open source version for now, though I do not really see any drawbacks yet.

Update: I did find a major problem with the setup. It's the keyboard layout switching... i.e. once you switch from English to French it is not possible to switch back easily.... So if you are a multilingual user beware of it!

Friday, November 6, 2015

Wifi connection from a command line (OpenSuse 13.2)

My 10 month SSD with Fedora stopped working recently and I had to put back in an old HDD with OpenSuse on it. Since it was awhile since I've last used it, I decided to update all the packages with zypper... So it went and upgraded the kernel... But that broke my nvidia drivers and I've ended up in the command line. That would be OK, if I could use the internet to get the driver and compile it for the upgraded kernel (to lazy to use usb). At this point, I've decided that time has come to eventually learn how to manage my wireless using command line tools. After some poking and googling I've found the utility called 'nmcli' (luckily it was already installed). And the command seemed pretty simple:
nmcli d wifi connect [ssid] password '[pass]'
But that, of course, did not want to work giving me the error messages like:
Error: Connection activation failed: (7) Secrets were required, but not provided.
And for some reason I've decided to do
killall wpa_supplicant
And after this the nmcli command above worked and I am online again. And I did not have to redo anything after reboot, which is very nice... I am not sure if 'killall wpa_supplicant' was required for a good reason or just because I was launching it following other tutorials... I've decided to log it here in case if, hopefully, this could save somebody (or even myself) from frustration in future. Cheers

Friday, October 16, 2015

Fedora 22 Gnome, motivation screenshot

This is the screenshot of my current system at home... Looks very nice. The theme is EvoPop, cursors: breeze_theme, icons are also evopop... The theme is installed through Fedy and set with Tweak tool.

Friday, July 10, 2015

Q4OS - motivation screenshot

I have changed a cooler in my lenovo laptop (which is very old T61p that I have had since 2008). And it really helped the performance. So I decided to stress test it with a virtual system. For a long time I was contemplating to test the Q4OS, which is a minimalist system. So here is the first screenshot from the current virtualbox installation.
I have only good things to say about it for now. It proposes and installs Google Chrome browser right from the start. "apt-get install" seems to work well.

Monday, March 2, 2015

Linux: execute a command periodically and watch the result

I am aware of cron and it does a great job when you want it to do something for you weekly, daily or with whatever frequency. But you have to configure it and stop it, and so on and so on. But what if you just want to quickly see something to start happening or the dynamics of something that is already happening and then just move on (for example new files start appearing in the folder). I needed this functionality because a model, that I use, stores the last executed time step in a text file and updates it after each time step (updates, so 'tail -f fname' does not help). What I was doing is executing 'cat fname' million times and frequently until I have found out about the 'watch -n 1 cat fname' (http://en.wikipedia.org/wiki/Watch_(Unix)), which does it for me every second and nicely updates the result. So I decided to write it here for my (and for anyone's) reference.

Friday, September 19, 2014

Youtube videos in chromium on OpenSuse 13.1

Recently I got tired and fed up with ubuntu/kubuntu and decided to go back to Opensuse 13.1. I installed it and almost everything works OK now. I do still have some troubles reanimating WIFI after sleep (I have to go to network configuration and enter my password for selected network). But this post is about video, so if you have chromium installed but youtube videos do not play then the following might help you solve your issue:
    sudo zypper rm chromium-ffmpeg
The above will remove chromium-ffmpeg and will install chromium-ffmpegsumo. If you do not have chromium-ffmpegsumo installed then install it:
    sudo zypper in chromium-ffmpegsumo
Hope this will help someone to make opensuse more enjoyable. Anyway even with these 2 annoyances I like opensuse more than ubuntu. (Maybe because I have not used it long enough yet:))

Thursday, August 15, 2013

Correcting netcdf file data and metadata using NCO

Sometimes we get data in netcdf files that do not really conform to the standards used by different tools that were developed for calculating standard properties of the data. Here an example is shown how the files of this type can be easily corrected using NCO and shell:



After having run the script the command `cdo infov fname` should give correct dates, minimum and maximum values (which previously was not the case): Here for comparison I've put the result of the same command on the initial version of the file:

Wednesday, July 24, 2013

Parsing model log file using bash, grep, head, tail and cat ...

In this script you can find an example of using grep with perl regular expressions, mathematical expressions in bash script, array, head and tail and cut (a simplistic text splitting utility for shell).

Friday, May 10, 2013

Bash: select a column from a file

If for example, you have a file with columns separated by spaces and you want to select a column of data from there, say number 9. This is easy to do in shell using the cut command (note that fields are indexed starting from 1):