Skip to content

Instantly share code, notes, and snippets.

@Jaywalker
Jaywalker / xbacklight.sh
Created August 12, 2019 15:46
An xbacklight (semi)-compatible alternative for unsupported systems (specifically my System76 machine)
#!/bin/bash
function usage {
echo "usage: $0 [options]"
echo " where options are:"
echo " -help"
echo " -set <percentage> or = <percentage>"
echo " -inc <percentage> or + <percentage>"
echo " -dec <percentage> or - <percentage>"
echo " -get"
@Jaywalker
Jaywalker / github-clone
Created April 9, 2019 20:53
Clone github repos to a centralized place on your system
#!/bin/bash
if [ "$1" == "clone" ]; then
if [[ "$2" = *"github.com"* ]]; then
GHUSER="`echo \"$2\" | sed 's/.*github.com\/\(.*\)\/\(.*\).git/\1/g'`"
GHREPO="`echo \"$2\" | sed 's/.*github.com\/\(.*\)\/\(.*\).git/\2/g'`"
if case $2 in git@*) true ;; *) false;; esac; then
GHUSER="`echo \"$2\" | sed 's/.*github.com:\(.*\)\/\(.*\).git/\1/g'`"
GHREPO="`echo \"$2\" | sed 's/.*github.com:\(.*\)\/\(.*\).git/\2/g'`"
fi

Keybase proof

I hereby claim:

  • I am jaywalker on github.
  • I am jaywalker (https://keybase.io/jaywalker) on keybase.
  • I have a public key ASDMWEufMHiJiT3M8EqEM0FRh467bGAxaf0fFsEMYtImpAo

To claim this, I am signing this object: