Pick a color with gpick and copy it to the clipboard:
gpick --pick --single --output --no-newline | xsel -b
To use with xbindkeys:
"(gpick --pick --single --output --no-newline | xsel -b -i) &"
trait Handler<Args> { | |
fn call(self) -> Result<(), ()>; | |
} | |
macro_rules! impl_for_tuple { | |
($($tys:ident),*) => { | |
impl<F, $($tys,)*> Handler<($($tys,)*)> for F | |
where | |
F: FnMut($($tys),*) -> (), | |
$($tys: std::str::FromStr,)* |
#!/bin/bash | |
set -eu -o pipefail | |
CMD="$(mktemp)" | |
for DIR in "$@" | |
do | |
echo "set -xe; montage \\" > "$CMD" |
set -xue -o pipefail | |
cd "$(mktemp -d)" | |
make-pkg sid gem2deb | |
dpkg -i debs/gem2deb*deb | |
gem2deb aws-eventstream | |
gem2deb aws-partitions | |
gem2deb jmespath |
#!/usr/bin/wish | |
package require json | |
# Data from current window | |
set window [ | |
json::json2dict [ | |
exec i3-msg -t get_tree \ | |
| jq ".. | (.nodes? // empty)\[] | select(.focused == true)" |
#!/bin/bash | |
# | |
# This program sends a query to Athena, and download the results in CSV when | |
# the execution is completed. It expects the database name and the query as | |
# arguments: | |
# | |
# $ query-athena -d mydb 'select ...' | |
# | |
# The CSV file is downloaded in /tmp/QUERYID.csv by default. To use a different | |
# file, use -w: |
#!/bin/bash | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: $0 output inputs*" | |
exit 1 | |
fi | |
set -e |
#!/bin/bash | |
role="$1" | |
aws iam list-role-policies --role-name "$role" \ | |
| jq -r '.PolicyNames[]' \ | |
| sort \ | |
| xargs -l1 aws iam get-role-policy --role-name "$role" --policy-name |
#!/usr/bin/env ruby | |
# | |
# Launch pastel commands using GST syntax. | |
# | |
# Example | |
# | |
# $ pastel random ! mix green ! lighten 0.2 ! format | |
# | |
# https://github.com/sharkdp/pastel is expected to be in | |
# /usr/local/bin/pastel. Change the PROGRAM constant if |