Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven Saus uriel1998

View GitHub Profile
@uriel1998
uriel1998 / openbox_tiling.rc
Created Jun 26, 2019
Openbox tiling emulation keybinds
View openbox_tiling.rc
<!-- Keybindings for moving windows -->
<keybind key="mod4-Left">
<action name="GoToDesktop">
<to>west</to>
<wrap>yes</wrap>
</action>
</keybind>
<keybind key="mod4-Right">
<action name="GoToDesktop">
<to>east</to>
@uriel1998
uriel1998 / smallcoverkill.sh
Created Nov 17, 2012
Small bash script to remove small cover images (or really, any small resolution images)
View smallcoverkill.sh
#! bin/bash
cd ~/Music
echo "Run this script from your base music directory (or wherever you want to purge png and jpg images from)"
echo "Currently in $PWD"
echo "What is the minimum resolution you want?"
read request
# test for number without decimal
if [ "$request" -eq "$request" ] 2>/dev/null; then
echo "Finding jpg covers."
find . -iname "*.jpg" -exec ls -f '{}' \; > tempfile.txt
@uriel1998
uriel1998 / style.css
Created Nov 25, 2012
CSS stylesheet for ePub
View style.css
/* You may notice that my CSS file is organized in a fairly straightforward and */
/* static way. This is intentional, folks. You can do a LOT fancier - but I'm */
/* operating under a KISS principle here. Otherwise it's too easy to have more */
/* than one style applying to any line and making troubleshooting difficult. */
/* My goal is portability and it NEVER distracting from the text. */
/* Put any additional fonts you REQUIRE here. I recommend using additional fonts */
/* only when you MUST; and always define a fallback. Please note that if you have */
/* the font in a sub-directory, you must define it properly in the src portion */
@uriel1998
uriel1998 / newwall.sh
Created Feb 13, 2014
Background manager, setter, tiler, mirrorer, etc - using mostly feh and imagemagick
View newwall.sh
#!/bin/bash
# Quite a bit of inspiration from https://gist.github.com/brycied00d/1190483
# I have a lot of backgrounds, and a laptop. I use xinarama, so my DISPLAY is always 0:0
# But I wanted to have one randomizer that used feh (2.9.3 is the version I have) but actually showed resolution-appropriate images.
# I also wanted to be able to select the color - "tiled", "orange", "blue", "black", "simple", "wide" (hooray for symlinks) at times.
# Uses xrandr to see if there is an HDMI monitor attached (which in my use cases always means I am rocking two monitors
#sets background
@uriel1998
uriel1998 / toodt.sh
Created Apr 25, 2014
A quick shell script to use pandoc to convert markdown to libreoffice and open it.
View toodt.sh
#!/bin/bash
# usage:
if [ -f "$1" ]; then
file=$(basename "$1")
filename=${file%.*}
pandoc "$1" -V geometry:margin=1in -s -o "$filename".odt
lowriter "$filename".odt
fi
@uriel1998
uriel1998 / simple_covers.sh
Created Apr 26, 2014
A simple cover art downloader/extractor.
View simple_covers.sh
#!/bin/bash
# requires mpc to get song info
# requires glyr https://github.com/sahib/glyr to retrieve metadata
# requires eyeD3 http://eyed3.nicfit.net/ to extract image from mp3
# uses xseticon, wmctrl, and transset to make its little terminal window all pretty. Feel free to delete these lines.
snark=$(echo $WINDOWID)
xseticon -id $snark ~/.icons/Faenza-Like/iKamasutra.png
@uriel1998
uriel1998 / subdir_copy.sh
Created Aug 14, 2016
Small shell script to copy each file in a directory into a subdirectory named the same as the filename (but not extension!) and then move the file into it.
View subdir_copy.sh
#!/bin/bash
dir=$(echo "$PWD")
for f in *
do
if [ -f "$f" ];then
# this is redundant due to how I'm searching, but why not?
filename=$(basename "$f")
extension="${filename##*.}"
@uriel1998
uriel1998 / plaintext-convert.sh
Last active Oct 15, 2020 — forked from sbrl/plaintext-convert.sh
Converter for pirate/bookmark-archiver that converts a plain-text list of urls into something it can understand.
View plaintext-convert.sh
#!/bin/bash
#set -o errexit
#set -o nounset
##############
# This program converts a plain-text list of urls to the
# bookmark-archiver HTML format.
#
# Requirements: curl, xidel
# Usage:
@uriel1998
uriel1998 / volume.rb
Created Feb 10, 2012 — forked from jaspervdj/volume.rb
Set PulseAudio volume, mute, unmute, and change default sink (and automagically switch running audio streams) from the commandline
View volume.rb
#!/usr/bin/ruby
#
# Moved to: https://github.com/uriel1998/volumerb
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/3.0/.
#
# Forked/derived from original by Jasper Van der Jeugt (jaspervdj);
@uriel1998
uriel1998 / usera_dropbox.sh
Created May 3, 2018
Script to run dropbox for multiple users on a headless server
View usera_dropbox.sh
#!/bin/bash
unset DISPLAY
HOME="/home/user/accountA"
/home/user/accountA/.dropbox-dist/dropboxd