Skip to content

Instantly share code, notes, and snippets.

@petarov
Last active June 11, 2023 10:58
Show Gist options
  • Save petarov/3701731 to your computer and use it in GitHub Desktop.
Save petarov/3701731 to your computer and use it in GitHub Desktop.
Arch Linux Hints and Tricks

Mouse and Keyboard power off

Do you use an usb mouse and keyboard and have laptop_mode installed under your Arch linux ? Then maybe you have the same problems as me - mouse and keyboard getting inactive every 2 seconds or so.

To solve this, go to /etc/laptop-mode/conf.d and copy usb-autosuspend.conf to /etc/laptop-mode/conf.d/board-specific. After that run lsusb and get the ID of the usb device you want, e.g., 093a:2500 .

Open the board-specific/usb-autosuspend.conf file and find the AUTOSUSPEND_USBID_BLACKLIST conf option. Put the desired usb IDs there. You might need to run sudo laptop_mode afterwards to reload the configs.

There you go. No more suspending of your usb devices attached ;).

Issues with Flash Player

flashplugin 11.2 is no longer supported by Adobe. Use chrome-pepper-flash

Joystick/Gamepad configuration

I had the same problems as you, and found 2 solutions

  1. remove xf86-input-joystick. All of my applications that required joysticks could detect them, unfortunately they lacked deadzone settings so joystick control was not as good as i wanted.

  2. the correct place for the startkeysenabled / startmouseenabled settings appears to be 50-joystick.conf, which comes with the xf86-input-joystick package.

this is my edited version of 50-joystick.conf :

  Section "InputClass"
      Identifier "joystick catchall"
      MatchIsJoystick "on"
      MatchDevicePath "/dev/input/event*"
      Driver "joystick"
      Option "StartKeysEnabled" "False"
      Option "StartMouseEnabled" "False"
  EndSection

Disable Monitor Standby

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
### add these
        Option "BlankTime" "0"
        Option "StandbyTime" "0"
        Option "SuspendTime" "0"
        Option "OffTime" "0"
EndSection

PulseAudio on Archlinux

Configuration

Configure with ALSA

Commands

  • pavucontrol - PulseAudio settings
  • pactl stat - Show defaults and configuration
  • pacmd - Intaractive PA console

Thinkfan for T430

Thinkfan is an excellent, small footprint fan control tool.

A tutorial is available on the Archlinux Wiki for T420, however there are differences when setting it up on T430 and newer Lenovo laptops.

Install Required Packages

First make sure you've got the acpi and lm_sensors packages installed.

pacman -S acpi lm_sensors

To configure sensor readings run:

sensors-detect

acpi -V shows current thermal and cooling info, e.g.,

Adapter 0: on-line
Thermal 0: ok, 66.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 200.0 degrees C
Cooling 0: x86_pkg_temp no state information available
Cooling 1: intel_powerclamp no state information available
Cooling 2: LCD 24 of 100
Cooling 3: Processor 0 of 10
Cooling 4: Processor 0 of 10
Cooling 5: Processor 0 of 10
Cooling 6: Processor 0 of 10

The current fan speed and level should be visible via:

cat /proc/acpi/ibm/fan

Install thinkfan from AUR via yaourt -S thinkfan.

Configurations

Create an acpi config file in /usr/lib/modprobe.d/thinkpad_acpi.conf and put the following inside:

options thinkpad_acpi fan_control=1

Create a configuration file in /etc/thinkfan.conf. Use the template from /usr/share/doc/thinkfan/examples/thinkfan.conf.simple.

Configure the temperature threshold settings. First find the temperature hardware sensors by running:

find /sys/devices -type f -name "temp*_input"

On T430 the configuration should like similar to the following:

### T430
hwmon /sys/devices/virtual/hwmon/hwmon1/temp1_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp3_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input

(0, 0,  40)
(1, 32, 55)
(2, 54, 66)
(3, 65, 76)
(4, 75, 80)
(5, 78, 85)
(6, 82, 88)
(7, 85, 32767)

0-7 are the fan levels to use. You can find what RPM values each level sets by running the following script:

        for i in 0 1 2 3 4 5 6 7; do
                echo "level $i" > /proc/acpi/ibm/fan
                echo "level $i..."
                sleep 8
                cat /proc/acpi/ibm/fan | egrep "^speed"
                echo
        done
        echo "level auto" > /proc/acpi/ibm/fan # reset level (important!)

Test

Start Thinkfan in non-daemon mode just to check if everything's running OK:

sudo thinkfan -n

You can monitor the temperature and fan levels by running:

sensors

Service Settings

To enable the Thinkfan service run:

sudo systemctl enable thinkfan

To start Thinkfan run:

sudo systemctl start thinkfan

In journalctl you should see log messages similar to the following:

systemd[1]: Starting simple and lightweight fan control program...
thinkfan[26232]: thinkfan 0.9.1 starting...
thinkfan[26232]: WARNING: Using default fan control in /proc/acpi/ibm/fan.
thinkfan[26232]: Daemon PID: 26234
systemd[1]: Started simple and lightweight fan control program.

UI Tools

On Xfce you can use the xfce4-sensors-plugin plugin to monitor your tempetarture and fan levels directly in a desktop panel.

Thinkpad Audio Keys

When using Archlinux with Xfce4 on a Thinkpad you may configure the audio keys using either of the two methods below:

Using Xfce4 Application Shortcuts

  • Go to Settings / Keyboard / Application Shortcuts
  • Click on Add
  • Enter the mute toggle command
    • No pulseaudio - amixer set Master toggle
    • With pulseaudio - amixer -D pulse set Master toggle

Using xbindkeys

On the command line:

Use the following to see what type of binding currently exist:

xbindkeys -s

Create a file .xbindkeysrc.scm in your home directory and add the following lines:

Toggle audio on/off:

(xbindkey '("XF86AudioMute") "amixer set Master toggle")

Note that you need to enter -D pulse, if you have pulseaudio installed.

Volume up

(xbindkey '("XF86AudioRaiseVolume") "amixer set Master 2dB+ unmute")

Volume down

(xbindkey '("XF86AudioLowerVolume") "amixer set Master 2dB- unmute")

Issues with Wi-Fi card

03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 3e) Subsystem: Intel Corporation Centrino Ultimate-N 6300 3x3 AGN Kernel driver in use: iwlwifi Kernel modules: iwlwifi

systemctl disable NetworkManager-wait-online.service
systemctl disable net-auto-wired.service
systemctl disable net-auto-wireless.service

What worked for me was:

systemctl disable net-auto-wired.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment