Skip to content

Instantly share code, notes, and snippets.

View khalid151's full-sized avatar

Khalid khalid151

  • Baghdad, Iraq
View GitHub Profile
@khalid151
khalid151 / old_pkg_versions.py
Created May 14, 2021 04:45
Print a list of old package versions of pacman cache
#!/bin/env python
'''
Print old package version paths of pacman cache
'''
import re
from glob import glob
pkg_name = re.compile(r'.+/(\w+)-')
@khalid151
khalid151 / wacom_focus.py
Created February 20, 2021 11:36
Wrapper around `xdotool` and `xsetwacom` to toggle wacom tablet focus between different monitors and windows,
#!/bin/env python3
from subprocess import check_output as output
from subprocess import run
from os.path import exists
from subprocess import CalledProcessError
import argparse
import re
import sys
wacom_max_res = (44800, 29600) # Width, height
@khalid151
khalid151 / window_swallow.lua
Created June 18, 2020 23:27
Give AwesomeWM DWM-like window swallowing
-- These are changes required to enable DWM-like window swallowing.
-- The code is some spaghetti mess but.. it works (TM)
-- First, a callback must be added to all clients to find PPID of the window, which
-- refers to terminal window PID.
-- The behaviour I've noticed when launching applications from within zsh shell,
-- the PPID of the launched window is actually the PID of the zsh instance.
-- So I had to get PPID of it, to get the PID of terminal.