This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
IFS=$'\n' | |
out=("$(rg --files --hidden | fzf --ansi -m --color dark,hl:172,hl+:46,fg+:26,bg+:235 --color info:150,prompt:26,spinner:150,pointer:26,marker:7,border:26 --border=sharp --prompt='➤ ' --pointer='➤ ' --marker='➤ ' --height 60% --expect=ctrl-o,ctrl-e )") | |
key=$(head -1 <<< "$out") | |
file=$(head -2 <<< "$out" | tail -1) | |
if [ -n "$file" ] | |
then | |
[ "$key" = ctrl-o ] && open "$file" || ${EDITOR:-vim} "$file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dir=("$HOME"/video) | |
get_selection() { | |
for p in $dir; do | |
ls "$p" | |
done \ | |
| fzf --ansi --height 80% --color fg:-1,bg:-1,hl:4,fg+:3,bg+:233,hl+:4 --color info:150,prompt:3,spinner:150,pointer:3,marker:174,border:11 --border=sharp --prompt='➤ ' --exit-0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Based on code from these stackoverflow answers: | |
# https://askubuntu.com/questions/60837/record-a-programs-output-with-pulseaudio/910879#910879 | |
# pulse-recorder.py -i --encoder "lame -r -q 3 --lowpass 17 --abr 192 - '%s'" -o '~/Music/"${RANDOM}".mp3' | |
import re | |
import subprocess | |
import sys | |
import os | |
import signal | |
from time import sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define player | |
player=mpv --cache=5000 | |
#try these stream qualitys | |
default-stream=worst,480p,best,high,low,720p | |
# Number of threads to use when streaming HLS streams | |
hls-segment-threads=2 | |
# Number of threads to use when streaming HDS streams | |
hds-segment-threads=2 | |
stream-segment-threads=3 | |
# Use this option to let the player stay or close itself instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Beware! This file is rewritten by htop when settings are changed in the interface. | |
# The parser is also very primitive, and not human-friendly. | |
fields=0 48 46 47 1 | |
sort_key=46 | |
sort_direction=1 | |
hide_threads=0 | |
hide_kernel_threads=1 | |
hide_userland_threads=0 | |
shadow_other_users=0 | |
show_thread_names=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
while true; do free | grep Mem | awk '{print $3/$2 * 100.0}'; sleep 1; done | osd_cat --align right --pos bottom -o 50 --lines 1 --delay 2 -f '-*-envy code r-*-*-*-*-24-*-*-*-*-*-*-*' -c orange & while true; do top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'; sleep 1; done | osd_cat --align right --pos bottom --lines 1 --delay 2 -f '-*-envy code r-*-*-*-*-24-*-*-*-*-*-*-*' -o 20 -c orange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Web; | |
/* | |
MIT License | |
Copyright (c) 2014 Christian Weyer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# install AUR packages with cower | |
cd $HOME/build/aur && cower -d "$1" | |
builddir="$_" | |
cd "$builddir" && ${EDITOR:-nano} PKGBUILD | |
makepkg -sirc && cd - &>/dev/null | |
read -p "Remove Build directory? [Y/n]? " yn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# (1) prompt user, and read command line argument | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
yellow=`tput setaf 3` | |
printf %"s\n" | |
printf %"s\n" | |
tput setaf 3 | |
blue=`tput setaf 4` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## script to blink the led on thinkpads | |
sudo chmod 666 /sys/class/leds/tpacpi\:\:thinklight/brightness | |
sudo echo 255 > /sys/class/leds/tpacpi\:\:thinklight/brightness | |
sleep 1 | |
sudo echo 0 > /sys/class/leds/tpacpi\:\:thinklight/brightness | |
sleep 1 | |
sudo echo 255 > /sys/class/leds/tpacpi\:\:thinklight/brightness | |
sleep 1 |