Tuesday, March 6, 2018

Xfce volume buttons (keyboard)

I got these fixes from a couple Internet sources.

Step 1: Make sure you have amixer installed (i.e., from apt-get)

Mute Button

  • Applications-->Settings-->Keyboard-->Application Shortcuts (tab)
  • If "XF86AudioMute" isn't already mapped, add this command
    • amixer -D pulse set Master toggle
    • It'll prompt you for the key. Select your mute button

 Volume up / down

  • Applications-->Settings-->Keyboard-->Application Shortcuts (tab)
  • Map these commands to your volume up and down keys:
    • amixer set Master 5%+
    • amixer set Master 5%-
That's it!

Tips: you can try these out in the console to see if they work.  Also man amixer is handy.

Sunday, March 4, 2018

XFCE4 Single Tap, multitouch, and brightness keys

I have an old Macbook Pro circa 2008, and recently I've been running Linux Mint 18.3 with Cinnamon desktop; however, I've been wanting to see what the other environments offer;  I tried a few, and Xfce seemed the cleanest to me.  There were, however, a few quirks that I didn't like:

  1. I couldn't change the brightness with the keys on my MacBook (cinnamon does)
  2. There was no option to enable the tap-to-click in the "Mouse and Touchpad" options, even though I saw some screen shots that showed it was supposed to be there.
Brightness Keys:  you need xfce4-power-manager
$ sudo apt-get install xfce4-power-manager
$ sudo reboot
Power Manager should be under Applications -->Settings
Single-tap / tap-to-click: there's a temporary and long-term fix

Temporary:  use libinput libinput on ArchWiki [this resets every boot, skip to next section for permanent solution]

List your devices so you can get the touchpad's id:

$ xinput list
xinput list

List the touchpad's properties:

$ xinput list-props 12


note: it's already "1" because I turned it on previously

"Tapping Enabled" is 276.  Putting this altogether (turn on tapping):

 $ xinput set-prop 12 276 1

(Again, this resets every reboot)

For a permanent solution, use xorg.conf file

Navigate to (Linux Mint 18 / Ubuntu):
cd /usr/share/X11/xorg.conf.d/

If it doesn't exist, create and open touchpad configuration
$ sudo touch 30-touchpad.conf
$ sudo pico 30-touchpad.conf

Using libinput on ArchWiki as a guide again, add the following:
Section "InputClass"
   Identifier "touchpad"
   Driver "libinput"
   MatchIsTouchpad "on"
   Option "Tapping" "on"
   Option "NaturalScrolling" "true"
   Option "ClickMethod" "clickfinger"
   Option "ScrollMethod" "edge"
EndSection

Save, reboot (or just log out/in).  Done.  Note that this configuration assumes you want a virtual scroll "box" on the right-edge of your touchpad instead of the normal 2-finger scroll (use "twofinger" instead of "edge").

End notes (taken from ArchWiki):
You may define as many sections as you like in a single configuration file. To configure the device of your choice specify a filter by using MatchIsPointer "on", MatchIsKeyboard "on", MatchIsTouchpad "on" or MatchIsTouchscreen "on" and add your desired option. See libinput(4) for more details. Common options include:
  • "Tapping" "on": tapping a.k.a. tap-to-click
  • "ClickMethod" "clickfinger": trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the docs.
  • "NaturalScrolling" "true": natural (reverse) scrolling
  • "ScrollMethod" "edge": edge (vertical) scrolling
Bear in mind that some of them may only apply to certain devices.

HTH