This is a collection of useful references, snippets, and information that I found useful when tinkering with Arch Linux.
Network
Wi-Fi Connection
Using iwd
- Make sure that
iwd
is running:
If not, start the service by running:> sudo systemctl status iwd
> sudo systemctl enable iwd > sudo systemctl start iwd
- Start the interactive prompt:
> sudo iwctl
- Find the name of the wireless device by listing all devices:
If the device is turned off, turn it on:[iwd]# device list
[iwd]# device [DEVICE_NAME] set-property Powered on
- Initiate a scan for networks:
then list all available networks:[iwd]# station [DEVICE_NAME] scan
[iwd]# station [DEVICE_NAME] get-networks
- Connect to the desired network:
Enter the passphrase (if prompted) to the network.[iwd]# station [DEVICE_NAME] connect [SSID]
Using nmcli
- Install
networkmanager
package if NetworkManager is not installed.> sudo pacman -S networkmanager
- Start / enable
NetworkManager.service
.> sudo systemctl start NetworkManager.service > sudo systemctl enable NetworkManager.service
- List nearby Wi-Fi networks:
Connect to a Wi-Fi network:> nmcli device wifi list
Disconnect an interface:> nmcli device wifi connect [SSID] password [PASSWORD]
Get a list of connections with their names, UUIDs, types and backing devices:> nmcli device disconnect ifname [INTERFACE]
Turn of Wi-Fi:> nmcli connection show
> nmcli radio wifi off
Battery
Check Battery Status
- Install
tlp
.> sudo pacman -S tlp
- Run the following command.
> sudo tlp-stat -b
Input Devices
Keyboard Input Remapping
Dual Function Keys
- Run the following command and find out the name of the keyboard.
> libinput list-devices | grep "^Device"
- Create a new configuration:
/etc/interception/udevmon.d/[KEYBOARD_NAME].yaml
. When using a wireless keyboard however, setting the name sometimes does not work. In this case, set the name to.*
, which processes every input. - Create a yaml file (conventionally resides in
/etc/interception/dual-function-keys
) that contains the configuration for Dual Function Keys itself. I use the following configuration: However, pressing the key will still send the original key on press, and this may interfere with programs such as (neo)vim. To prevent this, addHOLD_START: BEFORE_CONSUME_OR_RELEASE
.
Using evremap
- Install
evremap
from AUR:> paru -S evremap-git
- Enable / start the system service:
> sudo systemctl enable evremap.service > sudo systemctl start evremap.service
- Edit the service file to point to your config. First check the path of the service:
Then edit the file to point to your config:> systemctl status evremap.service
- Configure remapping to your taste:
Korean (Hangul) Input
This only works for hyprland
. Source
- Install
kime
from AUR.> paru -S kime-bin
- Add these in
~/.config/hypr/hyprland.conf
:# Execute kime exec-once = kime # Set envvars for kime env = XDG_CURRENT_DESKTOP,Hyprland env =GTK_IM_MODULE,kime env = QT_IM_MODULE,kime env = XMODIFIERS,@im=kime # Set ralt, rctrl to hangul and hanja input { ... kb_options = korean:ralt_hangul,korean:rctrl_hanja }
Miscellaneous
Run Fetch Script on Terminal Launch
OBS Virtual Camera
- Install the
v4l2loopback-dkms
package.> sudo pacman -S v4l2loopback-dkms
- Load the kernel module.
> sudo modprobe v4l2loopback
- To reload the module, first unload the module.
> sudo modprobe -r v4l2loopback
- For Chromium / WebRTC based applications, set option
exclusive_caps=1
.> sudo modprobe v4l2loopback exclusive_caps=1
GPG waiting for lock ...
Error
- Locate all files with
.lock
or.lck
extension inside~/.gnupg
.> ls -l ~/.gnupg/*/*.l{o,}ck
- Remove any lock files found.
Changing the default browser
- To get the current default web browser:
xdg-settings get default-web-browser
- To set the default web browser:
xdg-settings set default-web-browser [BROWSER]
Keyboard Backlight / Brightness
- Install
brightnessctl
:> sudo pacman -S brightnessctl
Keyboard Backlight
- Get the maximum brightness level (obtain the vendor name using
ls
in the directory):
Or alternatively:> cat /sys/class/leds/[VENDOR]::kbd_backlight/max_brightness
Then set the brightness using> brightnessctl --device='[VENDOR]::kbd_backlight' info
brightnessctl
:
Make sure to set the brightness level below the max level.> brightnessctl --device='[VENDOR]::kbd_backlight' set [BRIGHTNESS]
Brightness
- Same process as keyboard backlight, but use the path
instead.> cat /sys/class/backlight/[VENDOR]/max_brightness
Access System Clipboard in (Neo)Vim
I use hyprland
, so this only works for Wayland.
- Install
wl-clipboard
:> sudo pacman -S wl-clipboard
- Add the following line to
init.vim
:
Or toset clipboard+=unnamedplus
init.lua
for neovim:
Change Acceleration Profile for ThinkPad Trackpoints
Change libinput
acceleration profile for ThinkPad’s trackpoint from adaptive to flat.
This only works for hyprland
. Source
# Add to hyprland.conf
device {
name = tpps/2-ibm-trackpoint
accel_profile = flat
}
Extract data.tar.gz(or .xz)
from .deb
Use ar
from binutils
. binutils
is in the base-devel
group, so it should
be already installed. Source
> ar x <deb-file> data.tar.gz