linux

Tearing of fast action on NVIDIA

So with a brand new setup that includes a GLX/Geforce 1070 graphic card (will I ever be able to abuse all that GPU power?) I was somehow dissapointed to find non-uniform flickering, in other words the fast movement of things on screen was tearing. I didn’t prioritize this problem yet, but today I took time to look into it, and the following recipe solved it:

To avoid tearing, there’s a “workaround” – there are two options that seemingly need to be enabled in Xorg/nvidia driver: TripleBuffering and ForceCompositionPipeline (or ForceFullCompositionPipeline). My /etc/X11/xorg.com now contains the following in the “Screen” section:

To find out what is your screens layout, you can do

Also, if you want to fix tearing temporarily without changing any configuration files, use this command with something like that:

Supposedly forcing composition pipeline is causing some degradation in quality/speed in games.

Sources:
https://devtalk.nvidia.com/default/topic/543305/linux/screen-video-tearing-gtx6xx-7xx-kepler-9xx-maxwell-in-almost-all-applications-including-desktop/1
http://http.download.nvidia.com/XFree86/Linux-x86/325.15/README/configtwinview.html
https://forums.freebsd.org/threads/52311/#post-312833
https://forums.freebsd.org/threads/52311/#post-325927
http://us.download.nvidia.com/XFree86/Linux-x86_64/319.32/README/xconfigoptions.html

 

linux: auto-login

There’s couple of ways how to setup auto-login on linux. This one is geeky and not very user-friendly, but might come handy to somebody. This is on Ubuntu Linux 14.04.1/trusty with graphical login/desktop manager (lightdm) disabled.

install mingetty

edit /etc/init/tty1.conf so that it looks like this:

The most important part are the last three lines. Change username to what you have.

Edit your ~/.profile and add at the bottom:

Reboot and you should end up in your X session.

Sources:
askubuntu.com/quest…unning-upstart
https://wiki.archlinux.org/index.php/Xinit

switching caps-lock key into control key

There are couple of ways how to make your caps-lock key into control key. For some of use keyboard-shortcuts nerds keyboard usage optimisation is quite an important topic. One of useful things is to move (or rather add) a control (CTRL) key to the place where (rarely used) CAPS LOCK key is. This is especially usefull if one work in EMACS a lot. So, obviously emacs-wiki is a good source for various ways how to achieve that. See https://www.emacswiki.org/emacs/MovingTheCtrlKey for more. But specificaly in my case I used the following recipe for Debian and derivatives:

To make Caps Lock another Ctrl key, edit the file /etc/default/keyboard and change the line which reads

to

and then run:

Changes take effect on next login and seem to perpetuate across virtual terminals and X session.

processing applet on desired monitor

An example how to control on which monitor does processing applet (sketch output window) appear if you’re using multi-head setup:

multitouch with dual head/monitor Xorg

Having a multi-touch monitor (DELL P2314T) together with another non-multi-touch output confuses (in my case) the pointer maping – in other words, the pointer (mouse) is not where you touch the screen.

1) Make sure the touch screen is the leftmost monitor. Seems like offset-ing the pointer with xinput does not work (and something is buggy here), but scaling does. Actually that is not entirely true: offseting works with xinput, but in the case of multi-touch screen not being left-most the pointer is thrown to the rightmost pixel on X-axis the moment it’s supposed to appear on the multi-touch screen (this is true only for MT input, not for the actual mouse). If the touch-screen the leftmost, there’s no need to do offset, just proper scaling.

2) use xinput’s “Coordinate Transformation Matrix” to ‘remap’ it correctly:

see wiki.archlinux.org:Calibrating_Touchscreen

and here’s a simple /etc/X11/xorg.conf:

PostScript: make an A6 broshure (8 pages/sheet)

Had this lovely pdf (Music Marketing Handbook, 2007) and had difficulty reading it on screen and wanted to print it in a small (tiny?) broshure format. So, in Linux, I used this:

first convert PDF to postscript file

now the crazy command-line monster (this will take 8 pages in a block, scale them by 0.5, offset their position on a page and rotate four of them upside down):

convert postscript back to pdf, but make sure that GhostView doesn’t try to figure out the correct rotation!

This process will create pages with four pages on each, which you can print double-sided. It is then very simple to fold each of A4 sheets two times and just cut the top two folds.

bookletmaking2
booklet making

Booklet making

Switch CapsLock and Ctrl using xkb

Using CTRL as a modifier is quite frequent, especially in EMACS. Since it is usually (and definitely on my Thinkpad) placed in a position that can cause “Eamcs Pinky”, one of possibilities is to remap CapsLock to another Ctrl. Following a recipe on Emacs Wiki, this is one possible way: