Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JoshuaJChan's full-sized avatar

Joshua Chan JoshuaJChan

  • ON, Canada
View GitHub Profile
@JoshuaJChan
JoshuaJChan / arch-install.sh
Last active April 18, 2023 20:11
script to install Arch Linux
#!/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.
@JoshuaJChan
JoshuaJChan / .xscreensaver
Last active January 2, 2020 05:09
script to play videos on xscreensaver on i3 to then transition into i3lock (Needs xautolock too)
# 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 / low-battery.sh
Created June 2, 2020 19:42
script to notify low battery using crontab
#!/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