Wednesday, October 17, 2018

Use Disks (gnome-disks) to format and create a live usb

If the usb has a live linux on it it is more difficult to format than expected.

sudo apt install gnome-disk-utility
 
First, select "Format Disk" from the top right corner (NOT "Format partition" ), 


then select "Partitioning: No partitioning".
And only then select Additional partitioning options - "Format partition" , FAT, Next, Format.




 "Disks" (gnome-disk-utility) can also write an iso to the usb: after having formatted the usb as said above: go to Additional partitioning options as before, and select "Restore partition image", then select the Linux iso.

Monday, July 23, 2018

Control bluetooth speaker volume with keys and tray icon

Short-keys can be assigned to the following commands:
  • Toggle mute: amixer -q -D pulse sset Master toggle
  • Volume up by 5%: amixer -D pulse sset Master 5%+
  • Volume down by 5%: amixer -D pulse sset Master 5%-
For a panel/tray button, install qasmixer.
In Debian, Ubuntu: sudo apt install qasmixer.
enter image description here
To have it in system tray, go to its settings:
enter image description here

Sources here and here.

Enable tap to click in touchpad

In case there is no gui for that:

 
Based on this answer, given that I had to modify some of the instructions there:

The command to enable tap-to-click is therefore of the form:

xinput set-prop "device" "action" 1
 
To read the "device" you have to do

xinput list
 
But it may prove difficult to identify the device in that list. Some tips: it is probably under "Virtual core pointer"; it may contain terms like "Syn", "Synaptics", "Touchpad", "Alps", "Glidepoint". e.g., mine was AlpsPS/2 ALPS GlidePoint id=16, but I had to guess; as I was not sure I have tested if that was the correct ID number by disabling/enabling the touchpad with xinput --disable 16 and xinput --enable 16.

Now, to get rid of all the confusing names, ID-numbers can be used instead of the device and action names.
 
So, to read the "action":

xinput list-props 16
 
Which listed among others:

    libinput Tapping Enabled (297): 0
 
So, using ID numbers instead of names, the final command was:

xinput set-prop 16 297 1
 
(probably you'll have to set it to run at system startup)
 
In a similar way, based on `xinput list-props`, in order to enable margin scroll in touchpad, use something like
 
xinput set-prop 16 286 0, 1, 0 
 
 
 

Note: for some reason, using the name of the action within the command, as suggested by the main answer, wouldn't work for me (xinput set-prop ""AlpsPS/2 ALPS GlidePoint" "Tapping Enabled" 1), while using just the name of the device did work (xinput set-prop "AlpsPS/2 ALPS GlidePoint" 297 1)

Wednesday, July 4, 2018

Stop mouse from waking the system

Do

cat /proc/acpi/wakeup | sort
 
and look for items that are marked "enabled".
 
Then, test which of the commands like below stop the mouse from waking up the PC:
 
sudo sh -c "echo EHC1 > /proc/acpi/wakeup"
sudo sh -c "echo EHC2 > /proc/acpi/wakeup"
sudo sh -c "echo XHCI > /proc/acpi/wakeup"
 
If the `/etc/rc.local` file doesn't exist - create it and make it executable:

printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local
and add (kate /etc/rc.local) like so:

#!/bin/bash
echo EHC1 > /proc/acpi/wakeup
echo EHC2 > /proc/acpi/wakeup
echo XHCI > /proc/acpi/wakeup

exit 0

 
 
Reboot. 

Friday, June 15, 2018

Youtube paste comment in Firefox

about:config

Search:

dom.event

Change

dom.event.clipboardevents.enabled;true

to

dom.event.clipboardevents.enabled;false



Tuesday, May 22, 2018

Fix Firefox downloads files associations

When clicking downloaded files in Firefox they may be opened by the wrong applications.

Source: here.


 

 
When clicking a downloaded file in the list of downloaded files Firefox will use the first program listed in the line application/pdf= of the file usr/share/applications/mimeinfo.cache, which is set not by the default/system settings for that file-type (e.g: the default application for pdf was Okular, but that line was application/pdf=inkscape.desktop;okularApplication_pdf.desktop;, so that Firefox opened the files in Inskape instead of the default Okular.)
A solution is to modify that line or, even better (because that would not be overridden by other newly installed applications) to create a per-user file ~/.local/share/applications/mimeinfo.cache with lines like (example for pdf):

[MIME Cache] 
application/pdf=okularApplication_pdf.desktop;

The disadvantage of the above is that it is a per-file-type setting. To have a solution for all files, use the first commands posted above.

In case that stops working, be sure "Always ask" is selected under `about:preferences` in Firefox and then re-do the steps above.

A more radical change would be to remove the undesired application and/or reinstall the desired application (last installed takes over).
 
cd .local/share/applications/
ln -s mimeapps.list defaults.list