Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Simpson fooblahblah

View GitHub Profile
@fooblahblah
fooblahblah / toggle.sh
Created Jul 24, 2018
Script to raise and lower a window quake-style
View toggle.sh
#!/run/current-system/sw/bin/bash
SEARCHED_WINDOW=$1
WINDOW_ID=$(xdotool search --classname $SEARCHED_WINDOW|tail -n 1)
VISIBLE_WINDOW_ID=$(xdotool search --onlyvisible --classname $SEARCHED_WINDOW|tail -n 1)
if [ -z "$VISIBLE_WINDOW_ID" ]; then
xdotool windowmap $WINDOW_ID
xdotool windowsize $WINDOW_ID 100% 100%
xdotool windowactivate $WINDOW_ID
@fooblahblah
fooblahblah / toggle.sh
Created Apr 3, 2017
Hide/show a maximized window matching the search expression in arg $1
View toggle.sh
#!/bin/bash
SEARCHED_WINDOW=$1
WINDOW_ID=$(xdotool search --classname $SEARCHED_WINDOW|tail -n 1)
VISIBLE_WINDOW_ID=$(xdotool search --onlyvisible --classname $SEARCHED_WINDOW|tail -n 1)
if [ -z "$VISIBLE_WINDOW_ID" ]; then
xdotool windowmap $WINDOW_ID
xdotool windowsize $WINDOW_ID 100% 100%
xdotool windowactivate $WINDOW_ID
@fooblahblah
fooblahblah / default.nix
Last active Aug 25, 2018
Nix shell definition for Purescript
View default.nix
with import <nixpkgs> {}; let
runtimeLibs = [ gmp nodejs haskellPackages.stack ghc ncurses ];
libPaths = map (x: ":${x}/lib") runtimeLibs;
in rec {
env = stdenv.mkDerivation {
name = "purescript";
buildInputs = [ stdenv haskellPackages.stack ghc ncurses ];
LD_LIBRARY_PATH = lib.foldl (x: y: x + y) "" libPaths;
shellHook = ''
export PATH=$PATH:$HOME/.local/bin/
@fooblahblah
fooblahblah / default.nix
Created Nov 19, 2015
Nix JS shell template
View default.nix
with import <nixpkgs> {}; let
runtimeLibs = [ dbus glib gnome.gtk gnome.pango atk cairo freetype fontconfig gdk_pixbuf
xorg.libX11 xorg.libXrandr xorg.libXext xorg.libXi xorg.libXcursor xorg.libXfixes
xorg.libXrender xorg.libXcomposite xorg.libXdamage xorg.libXtst
gnome.GConf nss nspr alsaLib cups expat libcap systemd ];
libPaths = map (x: ":${x}/lib") runtimeLibs;
in rec {
N1Env = stdenv.mkDerivation {
name = "N1";
buildInputs = [ stdenv cmake pkgconfig libgnome_keyring nodejs python ];
View config.nix
{
allowUnfree = true;
packageOverrides = pkgs: rec {
# jre = pkgs.oraclejre8;
# jdk = pkgs.oraclejdk8;
sbt = pkgs.sbt.override {
jre = pkgs.oraclejre8;
};
};
}
@fooblahblah
fooblahblah / gist:8324644
Last active Jan 2, 2016
Given a window name, toggle window over - ala visor, yakuake, etc
View gist:8324644
#!/bin/bash
usage() { echo "Usage: $0 [-mh]" 1>&2; exit 1; }
while getopts ":mh" o; do
case "${o}" in
m)
echo "found m"
m="enabled"
;;