Skip to content

Instantly share code, notes, and snippets.

@jjrh
jjrh / ddcutil_switch_input.sh
Created May 22, 2025 15:50
script to switch input on a dell monitor using ddcutil
#!/bin/bash
#################################################
#
# ddcutil detect
# ddcutil --display=2 capabilities
# ddcutil --display=2 getvcp 60
# ddcutil --display=2 setvcp 60 0x0f
#
#################################################
@jjrh
jjrh / ddcutil_pip.sh
Created May 22, 2025 15:48
little script for toggling PIP on a dell monitor using ddcutil
#!/bin/bash
TARGET_DIS=1
VCP=E9
ON_VALUE=0x21
OFF_VALUE=0x00

Keybase proof

I hereby claim:

  • I am jjrh on github.
  • I am jjrh (https://keybase.io/jjrh) on keybase.
  • I have a public key ASAVD07uzmEi5HefAbduH11YBJ-1nHfTk1H-KkzNfcccsQo

To claim this, I am signing this object:

@jjrh
jjrh / stats.sh
Created March 19, 2020 15:53
show corona-stats from https://corona-stats.online every hour (change timedelay to be longer) ARG1 is country code. Empty arg is world stats. Ie: ./stats.sh CA
#!/bin/bash
x=1
inf=0
timedelay=3600
COUNTRY_CODE="$1"
while [ $inf -le 1 ]; do
clear
sleep 0.5
#!/bin/bash
# Author: Justin Hornosty (jjrh)
# Date: 2015-10-08
#
# jump_remember.sh
# ---------------------------
# desc:
# Remembers a window or jumps to a remembered window.
#
# usage:
#!/bin/bash
#####################################################################
#
# jjrh tab_by_class
# 2018-03-21
#--------------------------------------------------------------------
#
# tabs windows based on the windows class on the current desktop
# ex: tab_by_class emacs
@jjrh
jjrh / prosody_module_reload.js
Created April 14, 2017 23:12
reload a prosody module (or multiple modules)
var telnet = require('telnet-client');
var connection = new telnet();
var async = require('async');
var params = {
host: 'localhost',
port: 5582,
shellPrompt: '\ ',
timeout: 5500,
removeEcho: 4
};
@jjrh
jjrh / tintVert.sh
Created July 31, 2016 17:02
Start tint2 vertical config if it isn't running, if it's running kill it.
#!/bin/bash
EXIST=$(ps ax | grep "tint2_verticalrc" | grep -v grep)
if [ ${#EXIST} -eq 0 ]; then
tint2 -c ~/.config/tint2/tint2_verticalrc >>/dev/null 2> /dev/null &
else
kill $(echo $EXIST | cut -f1 -d ' ')
fi
@jjrh
jjrh / tintSwitch.sh
Created July 31, 2016 17:00
For swapping between a vertical config of tint2 and a horizontal config.
#!/bin/bash
getPID()
{
echo $1 | cut -f1 -d ' '
}
# create list of tint2 that are running
IFS=$'\n'
tints=( $(ps ax | grep tint2 | grep -v grep) )
@jjrh
jjrh / mpd_startup
Created July 12, 2016 16:26
checks if a program is running, if not, it tries to start it. # after 3 tries, if the program hasn't started we print out the error # and return.
#!/bin/sh
# checks if a program is running, if not, it tries to start it.
# after 3 tries, if the program hasn't started we print out the error
# and return.
errors=""
# uses pgrep to find the running process.
check_prog ()