Skip to content

Instantly share code, notes, and snippets.

@apotonick
Last active June 13, 2017 06:41
Show Gist options
  • Save apotonick/5b123ba98f54d3a45b87 to your computer and use it in GitHub Desktop.
Save apotonick/5b123ba98f54d3a45b87 to your computer and use it in GitHub Desktop.
Xubuntu hacks

Key to turn on laptop screen

I have a two monitor setup, but I like my laptop screen turned off (via Display).

When disconnecting the VGA cable, the screen is blank. I put the following command into ~/scripts/turn_on_laptop_screen.sh.

xrandr --output eDP-1 --mode 1366x768

This will enable the laptop screen. Find out the name of the display via xrandr -q.

Then, change the permissions.

chmod 755 scripts/turn_on_laptop_screen.sh

Now, I opened Keyboard / Application Shortcuts, added my script and put it on the Numlock button. When confronted with a black screen, I simply press this button and have a screen.

Pair Bluetooth Speaker

This blog post explains how: http://tuxdiary.com/2015/07/05/fix-stream-setup-failed-error-with-blueman/

Quoted:

Edit /etc/bluetooth/audio.conf and uncomment the following line:

AutoConnect=true

Run the following command to install latest packages forblueman and related modules:

$ sudo add-apt-repository ppa:blueman/ppa
$ sudo apt-get update
$ sudo apt-get upgrade blueman

You will need to install the pulseaudio bluetooth module if it’s not installed already:

$ sudo apt-get install pulseaudio-module-bluetooth

Check if the following lines are added in /etc/pulse/default.pa:

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

I also had to enable my box.

Volume Control / Configuration

Here, I had to set the Profile to “High Fidelity Playback (A2DP)” for my BT speaker box.

In Volume Control, you can now select the BT speaker as Output Device.

Then pair your speaker using the wizard. This has to be done only once, it will reconnect automatically (even after suspend).

Note: Currently, when rebooting, I have to load the module using pactl load-module module-bluetooth-discover, which sucks.

Mapping Volume Media Keys to Bluetooth Box

To allow changing the volume with the media keys, go into Volume Control / Output Device and click the weird green round button in your box section (Set as fallback).

Apple Keyboard

With my Xubuntu, I use an Apple keyboard. Here, Command and Alt are swapped. To change it back to your "Windows" layout, do this.

sudo vi /etc/modprobe.d/hid_apple.conf

Enter

options hid_apple swap_opt_cmd=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment