Pomodoro timers in i3 statusbar

The Pomodoro Technique

Pomodoro is an awesome productivity technique, one of the few that work for me, consistently, more than five years now. If you have not heard of it, the basic idea is the following:

  1. Decide on the task to be done.
  2. Set the pomodoro timer (traditionally to 25 minutes).
  3. Work on the task.
  4. End work when the timer rings and put a checkmark on a piece of paper.
  5. If you have fewer than four checkmarks, take a short break (3–5 minutes), then go to step 2.
  6. After four pomodoros, take a longer break (15–30 minutes), reset your checkmark count to zero, then go to step 1. 1Wikipedia: https://en.wikipedia.org/wiki/Pomodoro_Technique

Now playing: Iggy Pop – The Passenger

This works, for me usually 15 / 5 minutes, depending on the complexity of the task. For things that are very hard to do or for times when I don’t feel well at all, switching helps immensely. Usually it’s 5 minutes of a task that requires a lot of willpower, 5 minutes of something easier, 5+ minutes of pause. For tasks requiring more uninterrupted contentration, tasks that are easier for me, and when I feel well and productive, I go for 25 minutes / 5 minutes of pause.

This system is also nice because it implements the age-old rule of “rest before you are tired”. (I found that when I feel tired, it’s probably too late to rest, and my productivity is already impaired. I can force myself through it, but it would mean that I’d pay for it the next day.)  So the best metric I found for the exact ratio is the amount of willpower it takes to do something.

To implement this, I always used https://onlinetimer.ru/, and it’s absolutely perfect. You can even drag and drop individual timers and create bookmarks out of them:

i3 / i3status

But since I use it really a lot, I decided to make another keyboard shortcut for a timer, and visualize it in my i3 statusbar, to have a nice overview.

i3 is a(n awesome) tiling windows manager for Linux. Its statusbar is controlled in .i3/config:

This is the config for my smaller screen, which hides the statusbar except Mod4 (=Win) is pressed. It executes status_command, which in turn generates a statusbar with i3status using a certain config file, and then pipes the output through .i3/wrapper.py

My .i3status-small is not too creative. Maybe the only nontrivial thing is a run_watch which tells me if a VPN is running:

It checks if the file /etc/openvpn/mv.pid exists, if it does – the VPN in running. The vpn is run via the following aliased command:

alias o='sudo openvpn --writepid /etc/openvpn/mv.pid --config'

The result looks like this (click to enlarge)

i3status wrapper for custom commands

Now playing: Les Miserables 10th anniversary version – The Confrontation

First, I researched possible timers. Found utimer, It’s perfect.

Its output looks like this:

I added the following lines in .i3/config. The first line executes utimer, countdown 15 minutes, pipes the output to a textfile and plays a sound at the end of its execution. Third line kills the player.

I needed to prepend the timers to the statusbar, so I cound see how much time is left. For this, I used this excellent wrapper script. It’s built based on i3statusbar’s input protocol, documented here.

I added the following lines, heavily commented:

It’s quite a dirty solution, but it works. When there’s text, it gets outputted on screen after being split. If the timer program finishes, it outputs a \n instead of a ^M, and nothing is shown. They are colored so I know which timer is which.

I also added  a  third timer, which I can run from CLI and which both makes a sound and a popup, with optional text. Heavily based on this forum post. Its file also gets read by wrapper.py.

The statusbar with all three timers active looks like this:

Sometimes they break, probably because of the hack-y way I use to read the files outputted by the timer. Restarting i3 (which does not close any programs and is not a problem) helps, I have a shortcut for that.

The sounds I use are http://soundbible.com/2205-Bells-Tibetan-Large.html and http://soundbible.com/2170-Clock-Chimes-4x.html.

(Y)

SH

 

Footnotes   [ + ]

My experiences with Jupyter Notebooks, Pyplot and Sympy

As part of a course at my university, I needed to learn to do semi-basic mathematics in Wolfram Mathematica. I knew that it’s highly unlikely that I would ever use the (closed-souce, paid) program ever in the future if I’ll need to do scentific computation and/or visualization, simply because of my disliking such (closed-souce, paid) programs, and asked if I can do what was required using some different tools. For example, to see if I can use Sympy and Jupyter Notebook to do the same. Both professors agreed to this (which I really appreciated!), and I started. In this post I’ll describe my experience with Jupyter, Sympy and Matplotlib/Pyplot. If you want to follow along, the exact Notebook I use in this post is on Github, in German.

Continue reading “My experiences with Jupyter Notebooks, Pyplot and Sympy”

Pchr8board (third update to the Dvorak Mirrorboard layout)

Pchr8board

Now playing: Машингвери, штурмгевери

Hi!

You might remember the last two posts about the Dvorak Mirrorboard layout. Well, I’ve updated it for the third time, and it’s gotten different enough that I think I can call it Pchr8board, just to have a better name and to reflect the fact that it’s made for my own personal use and not as some kind of general-purpose layout, though it could be a nice starting point for further changes.

Ladies and gentlemen, Pchr8board:

2017-11-10-184406_617x367_scrot

Keys without a legend have the same letters attached.

Otherwise, this is how you read the picture above:

key_with_explanations

The layout uses left alt as a Latch key, that, when pressed with left thumb, switches the letters to their corresponding right-hand letters, as per original Mirrorboard, but for Dvorak.

Other important changed keys are highlighted.

  • Enter and BackSpace are on the Tilde (“~”) key.
  • The Tab key allows to type forward slashes (“/”), mostly for searching, and diaereses (ümläüts) on the letter immediately following Shift+Latch+Tab (awkward at first, but not more so than the typical compose key approach).

The layout is usable as a typical Dvorak one, and I wanted to add a couple of more keys that I miss. For the right hand, there are:

  • Direction keys on the Latch+”htnc”, which are the base keys for the right hand
  • A Backspace key on Latch+r

I sorely needed both of those, since they required too much movement in a traditional layout. What’s also nice is that all the keyboard shortcuts still work, that is for the OS it doesn’t make much difference. Selecting words word-by-word using Ctrl+Shift+right_arrow as Ctrl+Shift+Latch+n still works, for example. In practice such chords are much less complicated and easier to get used to than they seem. Honest.

At first, I wanted to add the arrow keys to the left hand, but didn’t find a not-awkward way to do this. Next version, maybe. Another logical change would have been using hljk or someting, since this is what I use for my i3wm shortcuts, but, again, I think keeping it classic in this aspect would be more beneficial.

Installation instructions:

  • Copy to your key definitions folder (usually /usr/share/X11/xkb/symbols/)
  • Either just setxkbmap left3 or integrate it in whatever you are using (e.g. setxkbmap -option 'grp:rshift_toggle, compose:rctrl' left3,ru,ua)
  • In case you want to edit it, copy it every time to a new name. The layout gets cached to the DE, and for it to read the new changes you would have to reload X, unless it’s a new file. Or just during editing do xkbcomp mirrorboard.xkb $DISPLAY 2>/dev/null as recommended in the original post, maybe removing the last part to see any errors.

The layout is on Github.

Source:

The following resources helped me:

(Y)

-SH.

 

Exporting Cambridge Brain Sciences data

Now playing: Ry Cooder – Jesus on the Mainline

Cambridge Brain Sciences is a nice way to measure brain health. After quick (~10 minutes) tests, it gives you your score in three main areas (Verbal, Reasoning and Memory) and your C-Score, which is “the summary of your cognitive function”. It’s meant not as a semi-static measure (~IQ), but as a “how are you feeling today” kind of thing.

I use it both as a way to track/manage some depression symptoms, and as an objective way to measure how various things influence your mental performance (think exercise/nootropics/sleep/…). I wrote a bit about it and how I use it here.

It’s pretty awesome, but lacks a CSV export, or even just a way to get the data in a readable format, without having to hover on their charts. I wrote them (they are pretty responsive and open to suggestions, by the way) and they said that they will add that as a planned feature. I  didn’t want to wait (patience is not one of my virtues) and wanted to start running some analyses on the data I have, but didn’t want to it down manually. Hovering over the data points in their chart to get the individual data points would have been very very tedious.

Looking at the source code (and hoping to find some “data.json” or something similar), I saw that for their charts they use Highchart. After skimming the documentation, I wrote small and extremely basic javascript snippet that would output the dates and datapoints of the currently open chart:

To use:

  1. Open the CBS dashboard
  2. Open the developer console.
  3. Paste snippet above

2017-11-08-225919_941x199_scrot

Then, if you need the verbal/memory/reasoning data, just switch to that tab and repeat the process.

For individual tests the process is very similar.

The snippet is the same, but you need to change the “chart” parameter. Switch to the “Tests” page, then right-click on the needed graph, “Inspect element”. You are looking for the data-highcharts-chart parameter:

2017-11-06-160037_380x139_scrot

This is the number you need. Set it in the first line of the snippet (chart=” “) and run.

To work with the data, I pasted it into LibreOffice calc with the following settings.

2017-11-06-160403_558x121_scrot

You need the “Separated by space” and “Merge delimiters”.

That way, it gets outputted to different cells, and you can copy the ones you need. I’m sure Excel can do something similar.

To merge the AM/PM on the other cell, I used the following formula to convert the time:

with B37 as cell with the time, and C37 as cell with AM/PM.

I hope I’m not infringing any terms of service, it’s not even scraping — just accessing the data already in the graphs. And I am not doing a tool or Greasemonkey script out of this, because I think that I won’t need to do this often (I add the data manually at the end of each tests if I do them), but if there’s interest, I could do something more “beautiful” and portable — let me know!

(Y)

SH.

Updated left-hand Dvorak Mirroboard keyboard layout! (Now with pictures!)

Now playing: Don’t stop believing by Journey

I updated my left-hand Dvorak Mirrorboard layout!

You might remember my last post on the topic, with the basic use cases and reasons why I bother.

This is an updated version of the layout, which I’m using now, with a couple of changes from the previous version:

  1. Different number keys
  2. Dead diaeresis/umlaut (öäëüï) on Shift+Mod+Tab (I need to type German from time to time, strictly for personal use).
  3. Fixed bug with []{} near the “real” backspace key, now they work!

2017-07-27-174355_372x331_scrot

How to read the image above:

key_with_explanations

 

 

 

The image of the layout was done with the absolutely excellent http://www.keyboard-layout-editor.com/.

Raw JSON of the layout:

Later on, when I will have time / will get inspired, I will write a general outline of my heavily modified keyboard layout, with a couple additional modifier keys, a couple of remapped keys, and how it al plays nicely with the i3 windows manager.

Up next, sometime, I should do a right-hand version. A bit less useful (still have to learn to eat with my left hand), but much more flexible in terms of functionality. I can reach much more keys with my right hand.

Over and out!

(У)

Dvorak Mirrorboard layout (Based on Randall Munroe’s Mirrorboard)

Update: New version of the layout can be found here; it has a number of improvements and visuals. History & Rationale remain in this post, though, along with installation instructions.


Now playing: Shia LaBeouf by Rob Cantor.

It all started when I was looking into options for one-hand typing, simply because it seemed like a pretty interesting thing to learn. (I love the feeling of the brain rewiring, haha.)

I stumbled upon this blog post by Randall Munroe about his Mirrorboard layout.

The key moment was when I realized that the brain command I use to type the letter ‘e’ is very similar to the one I use to type ‘i’. I found that if I held my right hand away from the keyboard and tried to type “the kitten parked the hovercraft”, it came out “tge dettev qarded gte gwvercraft” — I was doing the same motions with my left hand that I’d normally do with my right.

Mirrorboard is a keyboard layout that lets you type simple things on a QWERTY keyboard with only the left hand. It works by mirroring the layout between the left and right hands when you press caps lock. “asdf” becomes “;lkj” — the entire keyboard is reflected. To press a key on the right side of the board, you hold caps-lock with your pinky and then press the corresponding key on the left side.

Which is actually really fascinating and true.

After Googling around, I did not find any Dvorak version of the keyboard layout, so I decided to make one. Learning quite a lot about xkb and Linux’s handling of keystrokes in the process.

Another reason to change it a bit was because I use a pretty complex keyboard setup, with dvorak+Russian+Ukrainian, a compose key, and multiple remapped keys on my keyboard, and I wanted to integrate left-hand typing seamlessly in my workflow.

Changes made from the original Mirrorboard layout:

  1. Made it Dvorak-friendly
  2. Left-alt is used as modifier key, instead of Caps. (Which is remapped as Ctrl on my keyboard).
  3. Return is Modifier+Tilde
  4. Modifier+Tab is “/”
  5. Modifier key is a Latch-style key instead of Shift-style key. (Basically, the difference between the two is that Shift-style keys work only when pressed together with the key that’s being modified, while Latch-style keys may be pressed before the key, or at the same time, or twice to “Lock” it until the next time you press it; Here’s an excellent explanation)
  6. Adapted it to contain only the modified keys, so it can be put in /usr/share/X11/xkb/symbols/our_dvorak_mapping and later used as just another keyboard layout, say,  setxkbmap -option 'grp:rshift_toggle, compose:rctrl' dvorak,sh-mirror3,ru,ua (right shift to change keyboard layout, right Ctrl as compose key)
  7. Maybe some other things I have forgotten

Additional resources that helped me in the process have been this excellent post on how to create your own layouts and the legendary Arch linux wiki.

The layout is on Github.

To use:

  1. Fit it to your needs
  2. Copy to your key definitions folder (usually /usr/share/X11/xkb/symbols/)
  3. Either just setxkbmap sh-mirror3 or integrate it in whatever you are using (e.g. setxkbmap -option 'grp:rshift_toggle, compose:rctrl' dvorak,sh-mirror3,ru,ua)
  4. In case you want to edit it, copy it every time to a new name. The layout gets cached to the DE, and for it to read the new changes you would have to reload X, unless it’s a new file. (That’s why sh-mirror3; same number of tries as it took this person I learned this fact from). Or just during editing do xkbcomp mirrorboard.xkb $DISPLAY 2>/dev/null as recommended in the original post, maybe removing the last part to see any errors.

Then I did a couple of changes to my i3, cvim and keynav configs, to make them easier to use with just the left hand.

keynavrc

Keynav is an excellent little program to avoid using the mouse. I divide the screen in 16 areas, and decided to move the lower ones to my left hand, used with shift. Relevant fragment is:

On my keynav 0.20170124.0 the areas seem to be numbered vertically, not horizontally as mentioned on the page linked above.

cvim

Cvim is my favourite extension that adds vim-like keybindings to Chrome.

I added a keystroke to change the hint characters to left-hand ones and back, which conveniently was exactly the example given by the author for JavaScript mode:

All of this is definitely a work in progress, but it was really interesting.

Current left-hand typing speed is 12WPM, compared to my usual 80, I wanna see how and if it will improve. It’s really not about actual use, but because it seems something cool to do. Something like shorthand-writing, which I’ve almost learned. I wonder what comes next. Dozenal counting, perhaps?

Updated Fiamma “Add link” bookmarklet (now there are _two_ of them!)

Now I have a bookmarklet that gets triggered when I’m on a page I want to bookmark. It window.open()’s to the wiki page named after the page title and passes two parameters to the template: the title and the URI of the page. The template gets preloaded1More here: https://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text .

The template itself looks pretty trivial. (Note to self: Templates are case sensitive?!)

Then we get a page with an URI and a title. I fill the additional values like this:

Then I run the bookmarklet, which transform it to the following:

Then I could add something, and then save it.

The new bookmarklet now understands an unlimited number of keywords and categories.

The updated bookmarklet:

Todo:

Make it check for bad characters (think “|”, which mediawiki doesn’t like in names and parameters, and everything else here: https://www.mediawiki.org/wiki/Manual:Page_title; make it do something for empty titles, so I don’t get redirected to the main page; put together all of this and upload it to github?

The final bookmarklet looks like this:

Unrelated to the above:

Apparently, after N years of studying programming and tweaking/optimizing whatever incarnation of my workspace, I’m getting it. Like, you can really solve your own problems by writing your own code?! Wow!

What happens next? I’m gonna go around writing extensions and stuff? How was the quote: “Be a man, write your own drivers!”

Regardless, this small and dead-simple bookmarklet that solves my own problems has done much more for my motivation than anything else I’ve ever tried in the last couple of years.

Wohoo!

(Y)

Footnotes   [ + ]

Semantic Mediawiki for personal knowledge management, using templates and a custom userscript

Here I’ll try to document my current setup for links management, which is slowly starting to take form.

Как мы пришли к такой жизни

Since the social bookmarking site Delicious (old links page) is seriously falling apart (which is very sad, I liked it almost as much as I liked Google Reader) I started looking for other alternatives. For some time, I used WordPress LinkLibrary plugin until I felt the hard category system lacked flexibility (you can see on the “Links” page of this blog how cluttered and repetitive it is), I needed tags and more ways to organize the links and, possibly, the relationships between them.

Then for a very short time I set up a WordPress installation specifically for links. I was not the first one who attempted this (https://sebastiangreger.net/2014/01/own-your-data-part-1-bookmarks/ as an example), but it did not work out well for me.

As for the existing social bookmarking services, for example http://pinboard.in or http://historio.us/, I did not want to pay and wanted control of my data (thank God the export feature in Delicious worked more often than not, but I don’t want to risk it anymore).

As for the need to “share” it, I want to have access to it from various places and, since there’s nothing private, putting it in the cloud and putting a password on it sounds like an unneeded layer of complication. Lastly — who knows — maybe someone will actually get some use out of it.

Semantic Mediawiki

Mediawiki is the software Wikipedia runs on. Semantic Mediawiki is an open-source extension for it that adds the ability to store and query data on a whole another level.

Semantics means, basically, meaning. The difference between “60”, “60kg”, “My weight is 60kg.”

Traditionally, Mediawiki allows the pages to link to each other, but the exact nature of the connection is not clear, and you can’t use the connections much. Semantic Mediawiki allows to define additional data for every page, and allows to define relationships between pages. The data “Benjamin Franklin was born in the USA in 1706” suddenly becomes searchable, for example as “Give me the people born in America before 1800” and “Give me the list of countries where people named Ben were born”. A link “Benjamin Franklin -> Philadelphia” becomes “Benjamin Franklin was (BORN IN) Philadelphia”.

This is awesome.

After looking at it, I understood that I have immense power in my hands, and that I have no idea how to use it. As in, how to create an architecture that was both meaningful and easy to adhere to.

Seeing all this, I thought it would make sense to upgrade my “Link database” to something much more interconnected and useful, a personal knowledge management system.

And here it is.

2016-12-09-213801_1594x634_scrot

The system

Take this page.

Every page has 5 values:

  • l: The actual URI
  • t: the title
  • c: the complexity (how easy/hard is it to read; sometimes I just don’t want to think too much), 1 to 10
  • r: the rating, also 1 to 10
  • o: If it’s a page with only one link, around which the content of the page has been built. (As opposed to “Here are 5 links about X”)

Plus, of course, any additional text.

Properties can be set:

1) In the text itself, for example like this:

2) Invisibly:

which can be used like this:

My main goal for this was that it should be fast, and fast for me. I can type the above much faster than I can multiple input boxes in a hypothetical GUI.

Then I decided to write some bad javascript to simplify it even more.

The bookmarklet/userscript

An actual bookmarklet would be definitely the next thing I’m doing, until then I’ll be adding the pages manually.

But I wrote a small script (two years since I’ve used any Javascript, haha), to minimize the text above to just this:

The (badbadbad) Javascript code is the following:

The minimized variant of the above now sits nice in my bookmarks bar, and is bound to a keypress in cvim. So I can fill just the URI, and it sets everything else to some default values and adds the Mediawiki template formatting.

TODO:

  1. Getting the page title automagically (see http://stackoverflow.com/questions/10793585/how-to-pick-the-title-of-a-remote-webpage), I’ll need a PHP backend. It would be also interesting to check from the PHP if the IP making the request is currently logged in in my wiki, and get the title only then, to prevent abuse
  2. Making a bookmarklet which populates automatically most of the fields, like my old Delicious bookmarklet (sigh.)

Searching the wiki

The search in Semantic Mediawiki is explained pretty well here. Now I can do neat things like “Give me the pages in the Category ‘To read’ with complexity < 4”. And lastly, categories can be inside other categories. If X is in category  A, which is a subcategory of B, it still shows up in searches for category B. (example) Pretty nice!

Knowledge Management

Things I want to learn or will probably need pretty often will have their own pages, like the Formulating Knowledge page. Simply because interacting with the material always helps much more than just reading it. Also I like that it will be represented in a way relevant for me, without unnecessary data and with additional material I think should be there.

For the link pages, there will be the link + very short summary (it has been working pretty well) + a couple of thoughts about it, + maybe relevant data or links to other pages.

TODO: Quotes + Move there my “To Read” / “To Listen to” lists. Also think of a better name for it.

Why?

Warum einfach, wenn es auch kompliziert geht? (A nice German phrase about avoiding the unbearable simplicity of being: “Why simple, when it can be complicated as well?”)

On a serious note, I don’t have any doubts that in the long run I’ll be thankful for this system.

Firstly, I control all of this data. Feels good. Take that, capitalist ad-ridden surveillance corporations!

Secondly, working with a lot of information has always been something I do often and enjoy immensely, and it would make sense to start accumulating everything in one place. Every day I stumble upon a lot of material on the Internet, of very different nature, and with not-obvious connections between them. I have more interests than I can count.

Organizing everything like this so far looks to me the best alternative, and I’m reasonably certain it will work out. There’s a lot that can be improved, and I think in a couple of moths it will morph into something awesome.

Finding ways to use all the accumulated data is a topic for another day.

(Y)


A couple of nice relevant inspiring places:

http://yourcmc.ru/wiki/  – in Russian, a person using Mediawiki as central hub for everything.

http://konigi.com/wiki/  – personal wiki, mostly design.

http://thingelstad.com/2012/bookmarking-with-semantic-mediawiki/ a much more advanced version of what I’m trying to do, also using Semantic Mediawiki. I should drop him a line 🙂

Программированиие + пассивный доход + очередной пост о том, что делать со своей жизнью

Нехарактерно длинный постик о двух идея для веб-приложений, которыми мне бы хотелось заняться, и ресурсы/мысли на тему создания пассивного дохода.

Continue reading “Программированиие + пассивный доход + очередной пост о том, что делать со своей жизнью”

Programming

Okay.

  • Programming as a way to do brilliant things.
  • Programming as an art.
  • Programming as a way to challenge my skills.
  • Programming as a way to change the world.
  • Programming as a way to be free.
  • Programming as a way to have a purpose.
  • Programming as a way not to be afraid — “Я могу все.”
  • Programming as a way to improve myself.
  • Programming to BE.
  • Programming as an awesome thing to know.
  • Programming as magic.
  • Programming as a way to solve many problems.
  • Programming as beauty.
  • Programming as learning; programming as hunger for knowledge.
  • Programming as playing God.
  • Programming as constant self-improvement.
  • Programming as mindset.
  • Programming as opportunity to understand how complex systems work.
  • Programming as opportunity to understand how complex systems can be made work differently than intended.
  • Programming as a medium of expression.

Mounting LVS from Debian

Not that hard to find online, but after the fifth time I do this I think it would be nice to add it here. From https://www.linuxquestions.org/questions/fedora-35/how-can-i-mount-lvm-partition-in-ubuntu-569507/ + http://www.linuxwave.info/2007/11/mounting-lvm-disk-using-ubuntu-livecd.html

Vim, dvorak и кириллица

Всегда очень сильно бесила необходимость постоянно переключаться на англ. язык и обратно если я редактировал что-то, что использовало кириллицу, и нужно было делать что-то в normal mode. В первую очередь мешало при создании веб-страниц.

Об этой теме довольно много написано, но у меня проблема была так же в том, что я использую клавиатуру dvorak, и фокус с

Не прокатывал. Кириллические буквы печатались в соответствии с qwerty-раскладкой.

Решил написать собственный файл-раскладку по примеру существующих файлов. Ищем существующие файлы:

whereis vim, cd /usr/share/vim/vim73/keymap/, ls – и внезапно обнаруживаю russian-dvorak.vim, моей радости нету предела, итого:

в .vimrc.

Переключается через Ctrl+^.

Вообще это очень простой выход, но нетривиальный, и я в Интернете не находил ничего, что мне могло помочь, и я не решил бы проблему, если бы не захотел сам писать кастомный файл. Ибо проблема довольно узкая. (Однако – еще один плюсик vim за то, что этот файл там был, кто-то таки подумал об этом. Приятно.)

И кстати за одно еще парочка интересных моментов из того конфиг-файла. Включаем синтаксис, номеры строк, автоматическое индентирование, подсветку результатов поиска, а так же заменяем ооочень неудобную для нажатия Esc на комбинацию qj, которые редко используются и рядом находятся на клавиатуре. На саму работу не влияет, кроме ничтожной задержки при нажатии q (ибо работает в Insert mode).

How I remapped my Caps Lock key to Ctrl and made an additional mod key out of Ctrl

The idea came to me when I realized just how unfair it is for Caps Lock, which I never use, to be much easier to press with my small finger that Ctrl. And that I could bind a lot to my former Ctrl key.

So:

In autostart (~/.fluxbox/startup for me):

In ~/srv/mod4:

As a result:

In my .fluxbox/keys I can use mod3 for the key which used to be Ctrl:

And I can use Caps Lock as Ctrl. It really belongs more near the “a”, in my opinion. 🙂

The keycodes can be found via xev:

2014-10-31--1414752195_857x470_scrot

(“keycode 66” is the keycode of my Caps Lock key, which now gets recognized as Control_L.)

Random Linux bits and notes

За останні кілька років використання Лінуксу натрапляю на ті самі проблеми. Зараз учетверте шукав як міняти розкладку клавіатури через командну стрічку, щоб їх можна було змінювати автоматично. Сюди буду періодично кидати речі які я часто забуваю.

 1. Keyboard layout

^ Висить в автозагрузці awesomeWM. Relevant:
http://www.linux.org.ru/forum/general/6603527
http://awesome.naquadah.org/wiki/Change_keyboard_maps

Now Playing: Виктор Цой – Мама – анархия

2. Autorun in AwesomeWM

http://awesome.naquadah.org/wiki/Autostart

Now Playing: Fabrizio De Andre’ – Dolcenera

3. Sudo

Visudo: USER_NAME ALL=(ALL) ALL

Now Playing: Coolio ft 2pac, Snoop Dogg & BIG – Gangsta’s Paradise

4. Backgrounds

http://awesome.naquadah.org/wiki/FAQ

Now Playing: Cake – Friend Is A Four Letter Word

5. Concentrating

Написав цей скрипт щоб міняти місцями два hosts-файли:

Вміст hosts2:

Now Playing: Radiohead – Karma Police

6. Screen Brighntness (added 06/02/2013)

Now Playing: 2pac – Ghost

Поки все. 05/01/2012. TODO: Apache/PHP/MySQL + PHPMyAdmin + XFCE + fortune/cowsay/conky + Psi-plus + TOR/I2P