Skip to content

Instantly share code, notes, and snippets.

@jvalrog
jvalrog / scratchpad
Created November 6, 2018 19:44
An i3-like scratchpad using xdotool
#!/bin/sh
#
# SCRATCHPAD
#
# An i3-like scratchpad using xdotool.
#
# Example:
# ~$ scratchpad htop-pad urxvt -T htop-pad -e htop
#
# Explanation:
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD FX(tm)-4350 Quad-Core Processor
CPU Family: 0x15
@jvalrog
jvalrog / pamute
Last active August 21, 2022 11:55
Mute/Unmute individual Pulseaudio's streams using Rofi
#!/bin/bash
#########################################################
#
# PAMUTE
#
# Mute/Unmute individual Pulseaudio's streams using Rofi.
#
# Requires:
# - pactl
@jvalrog
jvalrog / xorganizer
Created August 10, 2018 18:10
Bash script that assigns windows to certain workspaces
#!/bin/bash
#################################################################################
#
# "xorganizer" is a simple bash script that assigns windows to certain workspaces
# by using the xdotool command.
#
# Supports matching by "class", "classname" and "name".
# It can be restarted on the spot by sending the SIGHUP signal.
#
@jvalrog
jvalrog / i2cdev.rb
Created May 11, 2018 17:48
Simple I2C Linux library for Ruby
=begin
Copyright 2018 Javier Valencia
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
@jvalrog
jvalrog / bme280.rb
Created May 11, 2018 17:47
BME280 Linux library for Ruby
=begin
Copyright 2018 Javier Valencia
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
@jvalrog
jvalrog / pi-menu.glade
Last active February 3, 2018 14:21
Pi-Menu, made with GTK3/Glade
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkWindow" id="main_window">
@jvalrog
jvalrog / gdax
Created January 28, 2018 10:15
GDAX bash tool to download currency pair prices
#!/bin/bash
function perror {
echo "$*" >&2
}
function check_dependency {
if ! command -v $1 &> /dev/null
then
perror "Missing dependency: '$1'. Please install it first."