Skip to content

Instantly share code, notes, and snippets.

@gitfib
gitfib / in-aur
Created June 20, 2020 13:11
Script to check if package(s) is in the AUR. Removed packages are not listed but still hosted
#!/usr/bin/bash
GREEN="\033[0;32m"
ORANGE="\033[0;33m"
RED="\033[0;31m"
NOCOLOR="--color"
[ "$1" == '--color' ] && shift
if [ "$1" == '--nocolor' ]; then
GREEN=""
@gitfib
gitfib / .CustomEdges.py
Last active June 3, 2019 12:09
Python script for better customization of the Active Screen Edges feature of KDE Plasma
#!/usr/bin/env python
'''
CustomEdges - Service and KWin script executor
Author: Amir Maimon
License: CC0 1.0 Universal Public Domain Dedication
License text can be found at COPYING or https://creativecommons.org/publicdomain/zero/1.0/
'''
from subprocess import call
@gitfib
gitfib / nixify
Created June 3, 2019 11:57
winify and nixify text files (line endings and .txt file extensions)
#!/usr/bin/env bash
for var in "$@"; do
if [[ "$(file --brief -i $var | awk '{print $1}')" == 'text/plain;' &&
"$(file --brief $var | grep CRLF)" ]]; then
dos2unix $var
base="$(basename $var)"
if [ "${base##*.}" == 'txt' ]; then
mv $var "${var%.*}"
fi