Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonardo Gama leogama

View GitHub Profile
@leogama
leogama / pulseaudio-equalizer-setup.sh
Created Sep 14, 2021
Script to setup PulseAudio equalizer module + qpaeq GUI as a desktop application
View pulseaudio-equalizer-setup.sh
#!/bin/sh -ux
# This is a small script to setup the PulseAudio equalizer as a desktop
# application that runs just when the 'qpaeq' GUI is open.
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or distribute
# this software, either in source code form or as a compiled binary, for any
# purpose, commercial or non-commercial, and by any means.
@leogama
leogama / appify.sh
Last active Jan 20, 2018 — forked from oubiwann/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
View appify.sh
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@leogama
leogama / man.sh
Created Sep 13, 2017
A smartish 'man' command for bash
View man.sh
function man {
local CMD=${@: -1}
# Strangely, 'whatis' and even 'man -f' may fail to find the command.
if whatis $CMD &>/dev/null || [[ $(info -w $CMD) == '*manpages*' ]]; then
command man "$@"
elif info -w &>/dev/null; then
info "$@"
else
for HELP in --help -h -help --usage; do
if $CMD $HELP &>/dev/null; then
@leogama
leogama / which.sh
Created Sep 13, 2017
A decent and portable 'which' command for bash
View which.sh
function which {
local CMD=$1;
if alias $1 &>/dev/null; then
CMD=$(alias $1 | sed "s/^alias $1='\([^' ]*\).*$/\1/");
if [[ "$CMD" != $1 ]]; then
type $1;
which "$CMD"; # recursive call for nested aliases
return;
fi;
fi;