Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, May 9, 2018

Making mouse pointer movement smooth with touchpad in Kubuntu 18.04

I have noticed that my mouse pointer (rather touchpoint pointer) moves in a jumpy manner while trying Kubuntu 18.04 Bionic Beaver on my Acer laptop.
After some research I've managed to fix this. Here's how:
1. Open Konsole
2. Run this command:
sudo apt install xserver-xorg-input-synaptics
(don't forget to enter your password :)
3. Reboot

That's basically it. After this you can open System Settings, go to Input Devices / Touchpad settings and further adjust Noise Cancellation if you really want to.

Here's a little video I made about it in Kdenlive (it was an excuse to spend some time learning the basics of Kdenlive, really :).


Makes me wonder why it isn't installed out of the box :|

Friday, October 9, 2015

Supervisor program groups

"Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems."
Simply put, it's a program that can run other programs for you. It does its job, it is mature and straightforward - just define your programs in a plain Windows-INI-style configuration file (although Supervisor doesn't run on Windows) and you're set.

But what if you've got a whole bunch of programs to run, isn't starting/restarting/stopping them one-by-one using supervisorctl going to be a major hassle? Yes, but Supervisor offers a solution: program groups! Define your programs as usual, but add a group entry to the conf file:

[program:a-program]
command=command-to-run-a-program
; etc.

[program:another-program]
command=command-to-run-another-program
; etc.

[program:yet-another-program]
command=command-to-run-yet-another-program
; etc.

[group:my-group]
programs=a-program,another-program,yet-another-program

Now, instead of issuing commands for each program like so:
supervisorctl start a-program
supervisorctl start another-program
supervisorctl start yet-another-program
or
supervisorctl restart a-program
supervisorctl restart another-program
supervisorctl restart yet-another-program
or
supervisorctl stop a-program
supervisorctl stop another-program
supervisorctl stop yet-another-program

you can just do
supervisorctl start my-group:*
or
supervisorctl restart my-group:*
or
supervisorctl stop my-group:*

And just imagine having 10 or 20 or even more programs to control!

Monday, December 22, 2014

Gedit as a developer's editor

A good text editor is an essential tool for anyone who writes code. Gedit is okay-ish out of the box, but many nice features are lacking. Here are the plugins I use to make life with Gedit easier:

  1. Gedit Source Code Browser: adds a new side panel that shows symbols (functions, classes, variables, etc.) in the code you're editing. This is a common feature found in virtually any IDE out there.
    Sadly, this plugin didn't work out of the box, so I had to make several modifications to make it:

    Went to ~/.local/share/gedit/plugins/ and in sourcecodebrowser.plugin replaced
    Loader=python
    
    with
    Loader=python3
    

    Because of switch to Python 3, I also had to replace the following line in sourcecodebrowser/ctags.py, in parse(self, command, executable=None:
    symbols = self._parse_text(p.communicate()[0])
    
    with
    symbols = self._parse_text(p.communicate()[0].decode("utf-8"))
    

    I'm not sure if this was really necessary, but it seemed logical to me not to supply 'ctags' executable name in the parameters string (since it's given separately as self.ctags_executable anyway). In sourcecodebrowser/plugin.py:
    command = "ctags -nu --fields=fiKlmnsSzt -f - '%s'" % path
    
    replaced with
    command = "-nu --fields=fiKlmnsSzt -f - '%s'" % path
    
    Once again, not sure this was needed.
  2. Gedit Restore Tabs. Does what it says - Gedit automatically opens all the files you had open in your previous session. Not having to recall where exactly are the files I was editing helps me concentrate on the code.
    Once again had to modify plugin definition file here. In restoretabs.plugin replaced
    Loader=python
    
    with
    Loader=python3
    
    But that was it. No source-code modification was required.

    Important update: I've encountered a text document that somehow causes Restore Tabs to crash Gedit on startup. A workaround is to remove this document from the list of files to be loaded on Gedit startup using dconf-editor tool (if you don't have it, do sudo apt install dconf-editor). To find the list, run dconf-editor and go to org -> gnome -> gedit -> plugins -> restoretabs. Remove the offending file from "uris", or just clear the list if you don't know which file is causing the problem.
  3. gedit-file-search: Gedit plugin to search a text in all files in a directory. No tweaking needed, nice!
  4. Plugins in gedit-plugins package, like Color Scheme Editor, Draw Spaces, File Browser Panel, Smart Spaces, Text Size and even a Python Console!