Last active
February 9, 2020 01:38
-
-
Save ckrzen/fb7ea934562d8834f69fc8625f4cc479 to your computer and use it in GitHub Desktop.
[dotfiles] Configs for my rigs!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CRONTAB ENTRY: */5 * * * * /home/chris/.BATTERY_LOW_WARNING >/dev/null 2>&1 | |
POWERSUPPLY=/sys/class/power_supply/ACAD/online | |
STATUS=$(cat $POWERSUPPLY) | |
BATTERY=$(upower -e | grep 'BAT') | |
BATTERY_LEVEL=$(upower -i $BATTERY|grep percentage|awk '{ print $2 }'|sed s/'%'/''/g) | |
if [ $BATTERY_LEVEL -le 15 -a $STATUS = 0 ] | |
then | |
env DISPLAY=:0 zenity --warning --modal --ellipsize --text='<b><big> *** RED ALERT ***</big>\n\n Battery is low!\n\nPlug in the charger asap.</b>' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conky.config = { | |
alignment = 'top_right', | |
use_xft = true, | |
format_human_readable, | |
draw_outline = true, | |
double_buffer = true, | |
own_window = true, | |
own_window_type = 'dock', | |
own_window_hints = 'below,sticky,skip_taskbar,skip_pager', | |
own_window_argb_visual = true, | |
own_window_argb_value = 125, | |
gap_x = 50, | |
gap_y = 35, | |
default_bar_width = 100, | |
} | |
conky.text = [[ | |
${font Roboto:style=Light:size=80}${alignc}${time %R}${font} | |
${font Monospace:size=8}${color Grey48}${execpi 60 ncal -bh | sed -e "s/\<$(date '+%-d')\>/\${color}&\${color Grey48}/" -e '/^ *$/d' | sed 's/^/${alignc}/'}${font}${color} | |
${font Roboto:style=Light:size=11}${color Grey48}System ${hr 2}${color} | |
${color Grey48}Hostname${color}${alignr}${nodename} | |
${color Grey48}Uptime${color}${alignr}${uptime} | |
${color Grey48}Temperature${color}${alignr}${acpitemp} °C | |
${color Grey48}Resources ${hr 2}${color} | |
${color Grey48}Processors${color}${alignr}${cpu cpu0}% ${cpubar cpu0} | |
${color Grey48}Memory${color}${alignr}${memperc}% ${membar} | |
${color Grey48}Swap${color}${alignr}${swapperc}% ${swapbar} | |
${color Grey48}Wireless${color}${alignr}${wireless_link_qual_perc wlo1}% ${wireless_link_bar wlo1} | |
${color Grey48}Battery${color}${alignr}${battery_percent BAT0}% ${battery_bar BAT0} | |
]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HeadUP() | |
{ | |
cat << EOM | |
$(tput bold) | |
* | |
** | |
*** | |
$(tput setaf 1) | |
DIST-UPGRADE for CKR-3 | |
$(tput sgr0) | |
EOM | |
} | |
export -f HeadUP | |
MidUP() | |
{ | |
cat << EOM | |
EOM | |
} | |
export -f MidUP | |
FootUP() | |
{ | |
cat << EOM | |
$(tput bold) | |
*** | |
** | |
* | |
$(tput sgr0) | |
EOM | |
} | |
export -f FootUP | |
clear | |
HeadUP | |
sudo apt-get update | |
MidUP | |
sudo apt-get --auto-remove dist-upgrade | |
MidUP | |
sudo apt-get autoclean | |
MidUP | |
cat /var/run/reboot* ; | |
FootUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec gnome-screensaver-command -l & | |
sleep 10 | |
inactive="The screensaver is inactive" | |
state=`gnome-screensaver-command -q` | |
if [ "$state" != "$inactive" ] | |
then | |
xset dpms 0 0 1 sleep 2 | |
xset dpms 0 0 20 | |
else | |
exit | |
fi | |
while [ "$state" != "$inactive" ] | |
do | |
sleep 5 | |
state=`gnome-screensaver-command -q` | |
done | |
xset dpms 0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%sudo ALL=NOPASSWD:/usr/local/bin/sysbacklight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# backlight brightness controls. use freely | |
# and adjust sysfs directory to your backlight type. | |
# $author Brice Burgess @iceburg | |
# modified by Chris Rainey for a Lenovo ideacentre AIO 300-22ACL | |
# running openbox on Ubuntu 16.04 | |
# sysfs="/sys/class/backlight/radeon_bl0" | |
# modified by Chris Rainey for a HP Notebook 15-ay039wm | |
# running openbox on Ubuntu 16.10 | |
sysfs="/sys/class/backlight/intel_backlight" | |
max=`cat ${sysfs}/max_brightness` | |
level=`cat ${sysfs}/brightness` | |
usage() | |
{ | |
script=${0##*/} | |
echo | |
echo "Invalid usage of ${script}!" | |
echo " $1" | |
echo "----------------" | |
echo "$script up : increases brightness" | |
echo "$script down : decreases brightness" | |
echo "$script set # : sets brightness to # (integer)" | |
echo "----------------" | |
echo | |
exit 1 | |
} | |
set_brightness() | |
{ | |
level=$1 | |
if [ $level -lt 1 ] ; then | |
level=1 | |
elif [ $level -gt $max ] ; then | |
level=$max | |
fi | |
echo $level > $sysfs/brightness | |
} | |
case "$1" in | |
up) | |
let "level+=50" | |
set_brightness $level | |
;; | |
down) | |
let "level-=50" | |
set_brightness $level | |
;; | |
set) | |
if [[ ! $2 =~ ^[[:digit:]]+$ ]]; then | |
usage "second argument must be an integer" | |
fi | |
set_brightness $2 | |
;; | |
*) | |
usage "invalid argument" | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEW LOCATION: | |
$ sudo ip -h -c l s wlo1 up | |
$ sudo iw wlo1 scan | egrep -i 'signal:|ssid:' | |
$ wpa_passphrase [SSID] >> .wpa.conf | |
$ sudo wpa_supplicant -i wlo1 -c ~/.wpa.conf -B && sudo dhclient -v | |
$ ip a | |
$ iw wlo1 link | |
KNOWN LOCATION: | |
$ sudo wpa_supplicant -i wlo1 -c ~/.wpa.conf -B && sudo dhclient -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment