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









Monday, January 15, 2018

Quake2 on Linux by compiling Yamagi Quake

On my previous post, I talked about using game-data-packager to install Quake2... but what if you want to do it from scratch?

This blog post is basically a distillation of the Yamagi Quake Readme.md, but I hope that it'll help.

  1. Download Yamagi Quake2 7.10
  2. Download q2-3.20-x86-full-ctf.exe patch
  3. Use Wine to extract the 3.20 patch to an empty directory, say, "quake2"
  4. Extract Yamagi Quake2 7.10 to the "quake2/" directory (above)
  5. Make a temp directory, say, "yamagi make files"
  6. Go into "yamagi make files" directory
  7. Clone repository:  git clone https://github.com/yquake2/yquake2.git
  8. Install Dependencies:  apt-get install build-essential libgl1-mesa-dev libsdl2-dev libogg-dev libvorbis-dev libopenal-dev zlib1g-dev
  9. Build it: type "make"
  10. Copy everything from the "release" folder into your "quake2" folder (step 3)
  11. Copy "pak0.pak" and "videos/" folder from a full version of the game to "quake2/baseq2" folder
  12. Start fragging:  Type "./quake2" in your quake2 folder
References:
https://www.yamagi.org/quake2/

Quake2 on Linux Mint [Jan 2018]

Background:  I have an early-2008 model Macbook Pro (MPB) and I wasted most of an entire extended weekend trying to put OS X El Capitan on (or something close to it) with little success.  The closest I could get was OS X Mavericks but then I got greedy and tried upgrading to El Capitan again...to no avail.

Fast-forward to this weekend and I decided to give up and just put Linux Mint 18.3 on it.  I've also gotten into a nostalgic period (maybe it's the winter), but I decided to started playing my old FPS games like Quake II and Quake I, and I thought, why don't I do this on my laptop?  It can certainly handle the game.

I'm writing this blog because this is definitely not the 1st time I've installed Quake2 on Linux... in fact, it's like the 1st time every time.

1st (Video):  Make sure you have the nVidia drivers enabled.  These can be found in:
Administration ---> Driver Manager
2nd (Wireless for MBP): I have a MacBook Pro, Early-2008 model, so I needed to enable my wireless drivers... it's a Broadcom (BCM4321), which Linux Mint detected, so I had to just enable this in "Driver Manager" again.  I'm currently just using Ethernet cable because it's faster, but the cable gets in the way.

Quake II

From what I understand (I may be mistaken), Linux Mint ships with the Yamagi Quake engine (search for it), which is what we're going to take advantage of here.

Check out my other post if you want to use Yamagi Quake from scratch


Install game-data-packager:  Get this from
Administration ---> Software Manager ---> Search "quake" ---> Select "Quake 2"
From what I understand, this program makes .deb packages to install the games; however, you'll need a full install of Quake II to access the data.

*game-data-packager will install your games in /usr/share/games/

 Package the game:  This took me some time to figure out.  To make a proper .deb install file, you need to point game-data-packager to a full copy of Quake2.  You have a couple options here:
  1. Use Wine to install Quake2 from Steam (install Windows .exe for Steam) so you can grab the files
  2. Grab your Quake2 folder from another machine
I picked choice 2, but either way you just need the path.  From your home directory (or wherever you want the .deb file to land) type this:
$ game-data-packager quake2 --package quake2-full-data /path/to/quake2
 *Note, if you just want the DEMO (which will auto-download):
$ game-data-packager quake2
Install the .deb file:  I simply double-clicked it in my window manager

Start Fragging:  Either type "quake2" in the console or find it under "Games" in your Start Menu 

End notes:
Yamagi Quake: There are other ways to do this, but I found this the easiest.  If you don't have Yamagi Quake, you can go here:
https://www.yamagi.org/quake2/


Set your screen resolution:  I'm on a MPB, 17" so I had to change the in-game settings for Quake2 to "fullscreen" and "1400x900", as that's my native resolution for this laptop.

Hope this helps.