Skip to content

Instantly share code, notes, and snippets.

View txtyash's full-sized avatar
🍀
Aw man! [hums happily]

textYash txtyash

🍀
Aw man! [hums happily]
View GitHub Profile
@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" "$@"
@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 / filename
Created July 20, 2022 10:16
Scrot commands to take screenshot of active window, selective and fullscreen
#!/bin/bash
# active
scrot -u 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
#!/bin/bash
# full
scrot 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
#!/bin/bash
# selection
@txtyash
txtyash / 40-libinput.conf
Created July 20, 2022 10:16
Configure touchpad in xorg to support natural scrolling, tap to touch, etc.
# Put this file in /etc/X11/xorg.conf.d/ directory and then reboot to reflect changes
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
@txtyash
txtyash / tags.sh
Created July 20, 2022 10:17
My scratchpad script in xmonad for handy stuff
#!/bin/bash
while true; do
action=x
clear
echo -ne "\n\t\tACTION?\n\n\tg(Go to)\tm(Move to)\n\tv(Vol)\t\tb(bright)\n\tk(kbd)\t\tt(touchpad)\n\tp(picom)\tn(network)"
read -r -n 1 action
clear
if [[ "$action" = "g" ]]; then
echo -ne "\n\n GO TO? a1 s2 q3 w4 d5 f6 e7 r8 t9:\n\n "
read -r -n 1 tag
@txtyash
txtyash / default.conf
Created July 20, 2022 10:19
Get audio working in xorg/X11 or tiling window managers in general
# Audio not working in tiling wms?
# This probably only works for intel audio cards
# Not sure if this will work for you
# Put this file in /etc/modprobe.d/
options snd_hda_intel index=1
@txtyash
txtyash / .xinitrc
Created July 20, 2022 10:20
My .xinitrc
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
@txtyash
txtyash / .xmobarrc
Created July 20, 2022 10:20
My xmobarrc for xmonad
-- Use the Nord theme: https://www.nordtheme.com/docs/colors-and-palettes
Config {
-- appearance
-- Hasklug is a much more readable font than mononoki, esp cus my bar is a bit small
font = "xft:FuraCode Nerd Font:weight=bold:pixelsize=14:antialias=true:hinting=true"
, bgColor = "#2E3440"
, fgColor = "#D8DEE9"
, position = Bottom
, border = BottomB
@txtyash
txtyash / arch.conf
Created July 20, 2022 10:22
Gummiboot file arch.conf (using zen kernel)
title Arch Linux
linux /vmlinuz-linux-zen
initrd /amd-ucode.img
initrd /initramfs-linux-zen.img
options root=PARTUUID=2d00f3a7-eda4-7a4a-86a7-d0e7a43302e9 rw quiet loglevel=0 console=tty2 acpi_backlight=vendor
@txtyash
txtyash / refind.conf
Created July 20, 2022 10:23
Gummiboot file refind.conf (using zen kernel)
timeout -1
hideui all
textonly
use_graphics_for linux
scanfor internal
default_selection 1