Skip to content

Instantly share code, notes, and snippets.

View jclarsson's full-sized avatar

Jamie Larsson jclarsson

View GitHub Profile
@jclarsson
jclarsson / gist:94f43b850a71be3fc17a
Created November 19, 2015 11:57
bspwm_border.sh
#!/bin/bash
####################################################################
# This script increases window padding when there are less windows #
####################################################################
KEEPTRUE=1
while [ $KEEPTRUE -eq 1 ]; do
VAR=$(expr $(bspc query -d $DESKTOP_SEL -W | grep -c "0x") - $(bspc query -d $DESKTOP_SEL -T | grep " f" | wc -l))
for w in $(bspc query -W -d); do bspc config -w $w window_gap $(expr 75 / $VAR ); done
@jclarsson
jclarsson / gist:7827221c827b2b06c080
Created November 19, 2015 11:59
workspace_names.php
<?php
/***********************************************************************/
/* Changes workspace names to dots. */
/* Uses https://mail.xfce.org/pipermail/xfce/2009-December/026489.html */
/***********************************************************************/
$id = time();
file_put_contents("/home/james/.config/workspace_names_start_time", $id);
@jclarsson
jclarsson / gist:887b20295233a079879f
Created November 19, 2015 12:00
xfce4-panel-opacity
#!/bin/bash
###################################################
# Makes panel opaque when a window is "Maximized" #
###################################################
KEEPTRUE=1
while [ $KEEPTRUE -eq 1 ]; do
if [ $(bspc query -d $DESKTOP_SEL -T | grep "0,0,0,0 M" | wc -l) -eq 1 ] && [ $(bspc query -d $DESKTOP_SEL -W | wc -l) -ge 1 ]
then
@jclarsson
jclarsson / reddit_wallpaper.php
Created March 26, 2016 14:35
Reddit Wallpaper
#!/usr/bin/env php
<?php
##################################
# CONFIGURATION - Edit this part #
##################################
$min_width = 1920; //Minimum width for images
$min_height = 1080; //Minimum height for images
$subreddits = "earthporn+skyporn+waterporn"; //Subreddits to pull from. Seperate each with a plus sign.