Skip to content

Instantly share code, notes, and snippets.

@gitfib
gitfib / in-aur
Created Jun 20, 2020
Script to check if package(s) is in the AUR. Removed packages are not listed but still hosted
View in-aur
#!/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 / nixify
Created Jun 3, 2019
winify and nixify text files (line endings and .txt file extensions)
View nixify
#!/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
@gitfib
gitfib / .CustomEdges.py
Last active Jun 3, 2019
Python script for better customization of the Active Screen Edges feature of KDE Plasma
View .CustomEdges.py
#!/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