Skip to content

Instantly share code, notes, and snippets.

View cirrusUK's full-sized avatar
💭
Dunroamin, Duncarin, Dunlivin.

cirrus cirrusUK

💭
Dunroamin, Duncarin, Dunlivin.
View GitHub Profile
#!/bin/sh
######################################
#> https://github.com/pystardust/ytfzf
######################################
############################
# Defaults #
############################
#!/bin/bash
trap "tput reset; tput cnorm; exit" 2
clear
tput civis
lin=2
col=$(($(tput cols) / 2))
c=$((col-1))
est=$((c-2))
color=0
tput setaf 2; tput bold
#!/usr/bin/bash
## uncomment lines 4-11 then add to zsh keybinds (default is ctrl+k)
#use fzf to kill proccesses
## fkill_widget() {
## sh $HOME/scripts/fkill # call fkill script locus
## zle reset-prompt
## }
## zle -N fzf-redraw-prompt # give me my $PS1 back
## zle -N fkill_widget
### MangoHud configuration file
### Uncomment any options you wish to enable. Default options are left uncommented
### Use some_parameter=0 to disable a parameter (only works with on/off parameters)
### Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead
################ PERFORMANCE #################
#gpu_name
### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless v-synced).
# fps_limit=
@cirrusUK
cirrusUK / fo
Created October 19, 2020 21:35
#!/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"
#!/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
}
#!/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
#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.
@cirrusUK
cirrusUK / htoprc
Created October 1, 2020 23:06
rc file for htop
# 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
#!/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