Skip to content

Instantly share code, notes, and snippets.

View txtyash's full-sized avatar

Yash Shinde txtyash

View GitHub Profile
@txtyash
txtyash / toggle_touchpad
Created July 20, 2022 10:12
Bash script to toggle touchpad/trackpad in xorg/X11
#!/bin/sh
# Toggle touchpad status
# Using libinput and xinput
# Use xinput list and do a search for touchpads. Then get the first one and get its name.
device="$(xinput list | grep -P '(?<= )[\w\s:]*(?i)(touchpad|synaptics)(?-i).*?(?=\s*id)' -o | head -n1)"
# If it was activated disable it and if it wasn't disable it
[[ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" == "1" ]] &&
xinput disable "$device" ||
@txtyash
txtyash / lvim-gui
Created July 20, 2022 10:10
Lunarvim gui frontend using Neovide
#!/bin/sh
# ~/.local/bin/lvim-gui
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$HOME/.config/lvim"}"
export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$HOME/.cache/lvim"}"
exec neovide -- -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"