23/05/2016

[Linux] Connect Android phone for file transfer

One of the things I like about Android, is the ease with which you can connect your device to any computer and start transferring files right away. Recent versions of the OS however are using MTP to perform the exchanges.

On some Linux distros, this means you need to install additional packages to keep using your phone as you prefer:

mtp-tools mtpfs

After installation, the phone should be accessible via your file manager

[LXDE] LUbuntu desktop composition enable key shortcuts

The openbox window manager bundled with LUbuntu is powerful enough to provide the same functionality as similar applications, but it's unfortunately delivered with a barebone configuration.

One functionality I'm missing it's the ability to drag, resize and snap windows to desktop sides. Luckily I found code pieces to enable such functionality, albeit not via mouse controls but key combinations; to add it, simply edit ~/.config/openbox/lubuntu-rc.xml and add under the line
 <chainQuitKey>C-g</chainQuitKey>  

this code:
 <keybind key="W-Left">    # HalfLeftScreen  
  <action name="UnmaximizeFull"/>  
  <action name="MoveResizeTo">  
   <x>0</x>  
   <y>0</y>  
   <height>100%</height>  
   <width>50%</width>  
  </action>  
 </keybind>  
 <keybind key="W-Right">    # HalfRightScreen  
  <action name="UnmaximizeFull"/>  
  <action name="MoveResizeTo">  
   <x>-0</x>  
   <y>0</y>  
   <height>100%</height>  
   <width>50%</width>  
  </action>  
 </keybind>  

Then just do an openbox --restart

You can now use the Windows key (Super) and the right or left arrow to snap the currently active window to the right or left side of the screen, at 50% width

Note: apparently openbox is reserving some space for the toolbar on the bottom of the screen, so even declaring 100% height will NOT fill all available space after resizing.

10/04/2016

[xterm] Edit appearance and store preferences

It's possible to edit the xterm console appearance and permanently store the changes by creating or editing the ~/.Xresources file. You can find the full list of settings on the man page, here are some useful ones:

XTerm*Background: white
XTerm*Foreground: black
XTerm*geometry: 140x45

The code above will set the default window size to 140x45 and display black characters on white background.

To apply the settings to all future xterm consoles, even after a reboot, just run once:

xrdb -merge ~/.Xresources

and finally restart xterm

[Kodi] Crash on exit bug fix

I was trying out Kodi, specifically the Kodibuntu version they provide, aka: Kodi installed on a quite barebone LUbuntu, and I must say I'm really impressed. Outputting 5.1 audio over SPDIF and watching HD movies is made very easy and works out of the box.

There is however one interesting bug that comes in various forms and basically causes Kodi to crash or freeze everytime you try to quit it.

The fix is very simple as the issue seems to be caused by the Version check addon; disabling it is sufficient to solve the problem.

09/04/2016

[LXDE] LUbuntu change clock format

Again, out of all the nice to have stuff people left out of LXDE, an easy way to edit the clock date and time format is missing.

Luckily, the tinkering required is minimal. Right click on the clock and select "Digital Clock" Settings, then enter the desired format in the Clock Format section.

For example:

%a %d %b %R

would result in:

[3 letters day name] [day number] [3 letters month name] [hours:minutes in 24 hours format]

eg:

Sat 09 Apr 16:17

[LXDE] LUbuntu change keyboard shortcuts

LXDE is extremely lightweight, maybe a bit too much, in the sense that they left out some user-friendly portions such as an easy graphical way to edit keyboard shortcuts.

You can still do it with a bit of tinkering, by editing the ~//.config/openbox/lxde-rc.xml file.

Remember that this syntax applies:

C = CTRL key
S = SHIFT key
A = ALT key
W = Windows key

[LXDE] LUbuntu auto num lock on boot

If you experience issues with the keyboard num lock not being automatically activated at boot or after lock screen wakeup in LXDE, try this:

- install numlockx:

sudo apt-get install numlockx

- edit /etc/xdg/lubuntu/lxdm/lxdm.conf and find numlock line then remove the comment and enable it:

numlock=1

- edit /etc/lightdm/lightdm.conf and add this line:

greeter-setup-script=/usr/bin/numlockx on