Skip to content

Instantly share code, notes, and snippets.

@Luis-Licea
Luis-Licea / environment
Created June 11, 2022 23:36
Use Fcitx or Fcitx5 for input method control.
# Add at the end of /etc/environment
# This is very close to what the Arch wiki recommends.
# Use Fcitx or Fcitx5 for input method control.
GTK_IM_MODULE='fcitx'
QT_IM_MODULE='fcitx'
SDL_IM_MODULE='fcitx'
XMODIFIERS='@im=fcitx'
@Luis-Licea
Luis-Licea / fstab
Last active June 21, 2022 19:56
Mount a read-write NTFS drive with udisksctl without root privileges.
# /etc/fstab: static file system information.
#
# By default, the command `udisksctl mount -b /dev/sdb1` will mount the hard
# drive with read-only access. The following options allow `udisksctl` to mount
# the drive with read-write permissions without using `su` or `sudo`.
#
# Settings: read `man fstab ntfs-3g` for options.
#
# LABEL - the disk label obtained by running the `lsblk -f` command.
# /urn/media/luis/DATA - the directory where I want the disk to be mounted.
@Luis-Licea
Luis-Licea / export-key-pair.sh
Last active June 21, 2022 19:56
Export and import GPG key pairs.
#!/usr/bin/env bash
# If there is only one argument:
if [ $# -eq 1 ] ; then
# Export the private key with the specified argument.
gpg --export-secret-keys --armor "$1" > "$1-private-key.asc"
# Export the public key with the specified argument.
gpg --export --armor "$1" > "$1-public-key.asc"
else
@Luis-Licea
Luis-Licea / fonts.conf
Last active June 21, 2022 19:57
Define system wide fonts in dwm, the suckless window manager.
<!-- Put in .config/fontconfig/fonts.conf -->
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Linux Libertine</family>
<family>Joy Pixels</family>
@Luis-Licea
Luis-Licea / 30-touchpad.conf
Last active June 21, 2022 19:57
Use graphics tablet Huion 1060PLUS on Linux dwm, the suckless window manager.
# Put in /etc/X11/xorg.conf.d/30-touchpad.conf
# Define touchpad behavior when using DWM.
Section "InputClass"
Identifier "touchpad catchall"
Driver "libinput"
Option "Tapping" "on"
Option "NaturalScrolling" "true"
EndSection
@Luis-Licea
Luis-Licea / hosts
Last active June 21, 2022 19:58
Block YouTube on Linux.
# Add this to the end of /etc/hosts
# Log out and log in for changes to take effect.
# To enable YouTube back, simply comment out or remove the section.
# Block YouTube.
127.0.0.1 www.youtube.com
127.0.0.1 m.youtube.com
127.0.0.1 youtube.com
127.0.0.1 youtu.be
127.0.0.1 ytimg.com
@Luis-Licea
Luis-Licea / profile
Created June 21, 2022 21:07
Allow dmenu to execute scripts in ~/.local/bin by adding directory in PATH.
# /etc/profile
# Set our umask
umask 022
# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
case ":$PATH:" in
*:"$1":*)