Skip to content

Instantly share code, notes, and snippets.

View evanjs's full-sized avatar

Evan Stoll evanjs

View GitHub Profile
@evanjs
evanjs / rbg
Last active May 2, 2018 01:51
Query images in $wallpapers and select a random image for each connected display.
#!/bin/bash
# sets a random background image with a resolution
# that matches each connected display
# Query connected displays
echo "Attempting to randomize wallpapers ..."
wallpapers="/usr/share/wallpapers"
# get a list of connected displays and their respective resolutions
displays=$(xrandr --prop | egrep '\sconnected' | awk '{print $1" " $3}' | cut -d '+' -f-1 )
@evanjs
evanjs / gdepends
Created March 29, 2018 15:47
Retrieve unique list of files installed by one or more Gentoo packages
#!/usr/bin/env sh
# returns a unique list of directories used by the provided packages
if [[ -z "$1" ]]; then echo "Please provide at least one package name to query"; exit 1; fi
excludes="doc/
man/
themes/
locale/
total_bugs = $$('td#bz_show_bug_column_1.bz_show_bug_column > table > tbody > tr:nth-child(21) > td > a')
closed_bugs = $$('td#bz_show_bug_column_1.bz_show_bug_column > table > tbody > tr:nth-child(21) > td > a[class*="bz_closed"]')
remaining_bugs = total_bugs.length - closed_bugs.length
console.log(`Total bugs: ${total_bugs.length}\nClosed: ${closed_bugs.length}\nRemaining: ${remaining_bugs}`)