Subscribe to RSS feed

splitbrain.org - electronic brain surgery since 2001

Weblog

Drink More Water

Lifehack: Drink water to avoid dehydration ;-)

I spend a lot of time at my computer. I'm also a lazy person. And even though I know I should get up and get another glass of water I often won't. Because ugh… that's work.

How could I solve this problem? I first looked into various water bottles, but somehow they were all either rather small (<2 liters) or a bit unwieldy. So i came up with a different solution:

There's a 5 liter water bottle in the shelf and the dispenser is rechargeable via USB. Problem solved.

Tags:
diy, water, hydration
Similar posts:
Last updated: 2018/08/31 22:17 · Permalink · Comments

Thinkpad X240 Arch Linux

It's 4 years since I got and setup my Thinkpad x240 using Xubuntu. I wasn't really happy with the Ubuntu subsystem anymore so I decided to set up a new OS. I went with Arch Linux this time. Still using XFCE as a Desktop Environment.

Many of the things I had to manually adjust for the hardware a few years ago now work out of the box. Below is a list of things I did.

Packages

After the basic install I installed a whole bunch of packages and configured them

  • still during the installation:
    • vim intel-ucode grub
  • Utilities:
    • git unzip bzip2 wget curl sudo fakeroot htop iotop make gcc openssh tree keychain imagemagick
  • XFCE Desktop:
    • xorg xf86-video-intel mesa xfce4 xfce4-goodies lightdm lightdm-gtk-greeter light-locker mugshot gnome-keyring
  • Fonts:
    • ttf-dejavu ttf-liberation ttf-droid ttf-ubuntu-font-family ttf-roboto noto-fonts ttf-bitstream-vera
  • Sound:
    • pulseaudio pulseaudio-alsa alsa-utils pavucontrol
  • Network:
    • networkmanager network-manager-applet nm-connection-editor networkmanager-openvpn openvpn gigolo gvfs gvfs-smb bind-tools
  • Devel:
    • php-apache php-gd php-intl php-sqlite xdebug nodejs yarn docker
  • Desktop-Apps:
    • chrome dropbox inkscape gimp geeqie hexchat

Emoji Picker

Install the ibus and noto-fonts-emoji and configure “Settings” → “Keyboard” → “Application Shortcuts”. Add

ibus emoji

as a shortcut (I'm using Meta+E). 🦊

Key Remapping

Remapping the PGUP/PGDN keys to POS1/END (and vice versa) is still something I highly recommend. Instead of doing it for X only, there is an easy way to do it on the Kernel level.

Right after installing Arch Linux, you will notice that the END key is not working properly in the linux console.

Pressing Ctrl-V, END will result in ^[[2~, though it should result in ^[[4~. The Wiki recommends adjusting /etc/inputrc, but since we want to remap keys anyway it is easier to simply remap the key to the proper keycode.

Mapping key presses to actual keys happens in the kernel. Each key creates a unique scan code that is then mapped to a key based on your keymap.

Using showkey –scancodes will show you the scan codes generated by the keys in question. Calling showkey will show you the keycodes the keys are mapped to. The problem is that the END is mapped to keycode 110 instead of 107 (the END key on my desktop system) - this is why the END key behaves weird in the console.

Keycode Scancode remap to
PGUP 104 e049 102
PGDN 109 e051 107
POS1 102 e047 104
END 110 (107) e052 109

Keys can easily be remapped using the setkeycode tool. To do so on boot, we need some startup script. In the olden days, we had /etc/rc.local for that. Today we need some help from systemd. Luckily there's a systemd service that can give us our rc.local back. It's available from AUR so I installed it with yay:

$> yay -S rc-local

Simply create a your startup file:

#!/bin/sh -e
 
setkeycodes e049 102 e051 107 e047 104 e052 109
 
exit 0;

Then make it executable and setup the systemd service.

#> chmod 755 /etc/rc.local
#> systemctl enable rc-local
#> systemctl start rc-local

Touchpad

Modern Xorg uses libinput instead of the old synaptics driver. It works nearly perfect out of the box. However you probably want touchtap clicking and may want to reconfigure two-finger taps as middle click instead of right click.

It's quite easy with a single additional config file:

Section "InputClass"
	Identifier "touchpad"
	Driver "libinput"
	MatchIsTouchpad "on"
	Option "Tapping" "on"
	Option "TappingButtonMap" "lmr"
EndSection



That's it. Everything else is just working fine out of the box.

Tags:
laptop, notebook, archlinux, howto
Similar posts:
Last updated: 2018/06/21 09:48 · Permalink · Comments

DIY Digital Picture Frame

As you may have noticed, Kaddi and I take lots of photos on our vacations. But what good are vacation photos if you never look at them? So when we redecorated the living room recently, we wanted a way to incorporate our pictures as wall decoration. So we were looking to buy a digital picture frame…

We probably ordered every model Amazon has on offer and holy shit are they crap. Not only are they all cheap plastic, they also have horrible resolutions, weird software and sometimes simply not even work. The only decent model we found was the Nix Advance 10 inch. If you want to buy one, get a Nix model.

However even though the Nix 10“ worked fine, we wanted something we could mount to the wall and that looks like an actual frame. So I built it myself.

Last updated: 2018/05/12 13:39 · Permalink · Comments

Hacking an EL-wire Inverter

I recently discovered electroluminescent wire or short EL-wire. It's this cool wire that glows when you apply a current. I had the idea to illuminate our Whiskey cabinet (which really is an old ammunition crate) when you open it.

elwire.jpg I bought a meter of orange wire off eBay for about 7 Euro. EL-Wire requires an inverter that converts DC to AC power. My wire came with a simple one that takes two AA batteries.

Unfortunately that EL driver has a push button that switches through three modes when clicked: on, blinking and off. Since I only need on and off controlled by a DPDT switch, I had to figure out how to hack that onto the controller. Turns out it isn't too hard:

  1. Unscrew the one screw at the back and open the controller
  2. Use a screwdriver to gently push the battery contacts out of the plastic to get access to both sides of the PCB
  3. Flip the PCB upside down and desolder the push button
  4. Add wires through the holes and solder them onto the two contacts on the side of the switch that's closer to the battery (A+B)
    • this overrides the three mode behavior controlled by the microchip under the white blob
    • if you want to keep the three mode behavior but just need a longer trigger cable you can also use the original switch solder points (A+C)
  5. Move the new wires back through the switch hole
  6. Optionally apply some hot glue to the transformer in hope of muffling the high pitched noise a bit
    • didn't have much effect for me
  7. Solder your switch to the other end of the new wires
  8. Reassemble everything

Here are the steps as photos again:

Tags:
electronics, elwire
Last updated: 2018/04/09 23:44 · Permalink · Comments

Older Posts are available in the Archive. Keep up to date with the RSS Feed.

Blog

Older Articles are available in the Archive, subscribe to the
Full Content RSS Feed to stay tuned. You can also subscribe to the Link RSS Feed.