Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Chan JoshuaJChan

  • ON, Canada
View GitHub Profile
@JoshuaJChan
JoshuaJChan / low-battery.sh
Created Jun 2, 2020
script to notify low battery using crontab
View low-battery.sh
#!/bin/sh
#requirements: zenity, mpv, acpi, https://www.freesoundslibrary.com/positive-tone-sound-effect/,
count=0 #timer after critical battery range is reached
export DISPLAY=:0 #capture the right monitor to display the popups
#read in status and number charge
read -r status capacity <<<$(acpi -b | awk -F'[,:%]' '{print $2, $3}')
#check if on battery and between 0-4%
if [[ $status == "Discharging" && "$capacity" -le 4 ]]; then
@JoshuaJChan
JoshuaJChan / .xscreensaver
Last active Jan 2, 2020
script to play videos on xscreensaver on i3 to then transition into i3lock (Needs xautolock too)
View .xscreensaver
# XScreenSaver Preferences File
# Written by xscreensaver-demo 5.43 for play on Mon Aug 5 20:23:29 2019.
# https://www.jwz.org/xscreensaver/
timeout: 12:00:00
cycle: 12:00:00
lock: False
lockTimeout: 0:00:00
passwdTimeout: 0:00:30
visualID: default
@JoshuaJChan
JoshuaJChan / arch-install.sh
Last active Jan 3, 2020
script to install Arch Linux
View arch-install.sh
#!/bin/bash
## Assumes ##
# Working internet connection
# Pre-installation work already done
## Instructions ##
# After booting into Arch ISO, run:
# curl -sL https://git.io/JexlX | /bin/bash
# and follow the instructions on the script.