Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Dunroamin, Duncarin, Dunlivin.

cirrus cirrusUK

💭
Dunroamin, Duncarin, Dunlivin.
View GitHub Profile
@cirrusUK
cirrusUK / chunkdel
Created Mar 25, 2021
use fzf to list & delete chunk.io uploads
View chunkdel
#!/bin/zsh
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
id=$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' )
IFS=$'\n'
out=("$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' | fzf -m --color dark,hl:172,hl+:46,fg+:46,bg+:235 --color info:150,prompt:46,spinner:150,pointer:46,marker:7,border:46 --border=sharp --prompt='' --pointer='' --marker='' --height 60% --expect=ctrl-o,ctrl-e | cut -d" " -f1 )")
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]
then
@cirrusUK
cirrusUK / chunkls
Created Mar 25, 2021
use fzf to list chunk.io uploads
View chunkls
#!/bin/zsh
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
id=$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' )
IFS=$'\n'
out=("$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' | fzf -m --color dark,hl:172,hl+:46,fg+:46,bg+:235 --color info:150,prompt:46,spinner:150,pointer:46,marker:7,border:46 --border=sharp --prompt='' --pointer='' --marker='' --height 60% --expect=ctrl-o,ctrl-e | cut -d" " -f1 )")
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]
then
@cirrusUK
cirrusUK / fgist
Created Mar 25, 2021
fuzzy finder for gist
View fgist
#!/bin/zsh
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
IFS=$'\n'
out=("$(gist -l | fzf -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 | cut -d" " -f1 )")
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]
then
@cirrusUK
cirrusUK / mpvnp
Last active Mar 24, 2021
mpv now playing uses libnotify (dunst) and osd_cat notify.lua calls mpvnp,notifies on startup and file change. mpv_osd
View mpvnp
#!/bin/bash
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
icon="/home/cirrus/.icons/play-4-48.png"
SERVICE="mpv"
MPVNP=$(ponymix list --short | awk -F '\t' '/sink-input/ && $4 == "mpv Media Player" {print $3}' ) ;
if pgrep -x "$SERVICE" >/dev/null ; then
sleep 3
dunstify -i "$icon" -r 100 "📺 MPV Now Playing " "$MPVNP" && echo -n "$MPVNP" | osd_cat -A left -p bottom -f '-*-envy code r-*-*-*-*-22-*-*-*-*-*-*-*' -o 40 -c '#00ff00' -s2
View ytfzf
#!/bin/sh
######################################
#> https://github.com/pystardust/ytfzf
######################################
############################
# Defaults #
############################
View shelltree.sh
#!/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
View fkill
#!/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
View MangoHud.conf
### 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=
View fo
#!/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"
View fzfvid
#!/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
}