Skip to content

Instantly share code, notes, and snippets.

View bulletmark's full-sized avatar

Mark Blakeney bulletmark

  • Brisbane Australia
View GitHub Profile
@bulletmark
bulletmark / archclean.sh
Created February 26, 2023 23:18
Arch Linux script to clean system
PROGARGS="$*"
JTIME="2weeks"
# First AUR helper found in this list will be used
AURHELPERS="yay paru trizen pacaur"
usage() {
echo "Usage: $(basename $PROG) [options]"
echo "Clean system and user package caches and prune journal."
echo "Options:"
@bulletmark
bulletmark / PKGBUILD
Last active August 16, 2023 22:44
Arch Linux patch for mutter 44.3-1 to revert commit 3ac82a58 to fix issue https://gitlab.gnome.org/GNOME/mutter/-/issues/2690
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Michael Kanis <mkanis_at_gmx_dot_de>
# Contributor: Mark Blakeney <mark dot blakeney at bullet dash systems dot net>
pkgbase=mutter
pkgname=(
mutter
)
pkgver=44.3+r0+g99d83f298
@bulletmark
bulletmark / gs-extract.sh
Last active September 1, 2023 00:50
Bash script to extract GNOME shell javascript files
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "usage $0 dir" >&2
exit 1
fi
dir="$1"
if [[ -e $dir ]]; then
echo "Error: $dir already exists" >&2
@bulletmark
bulletmark / p03
Last active December 6, 2023 22:10
#!/usr/bin/env python3
import math
from dataclasses import dataclass
import fileinput
@dataclass
class NUMBER:
value: int
length: int
coords: tuple[int, int]
@bulletmark
bulletmark / wifi-switcher
Last active January 2, 2024 03:06
Small program to switch wifi off/on when wired connection goes on/off
#!/usr/bin/env python3
# If you are using Linux NetworkManager then this program toggles your
# wifi connection off->ON whenever your wired connection goes ON->off,
# and vice-versa. Simply copy this to
# /etc/NetworkManager/dispatcher.d/99-wifi and ensure it is executable.
# No configuration is required. Get the latest version from
# https://gist.github.com/bulletmark/8e051a0a9ffdce689d86988c528e7764
# Author: Mark Blakeney, Jun 2020.
from __future__ import annotations
import subprocess