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
@cirrusUK
cirrusUK / hud.sh
Created June 14, 2021 01:12
Heads Up Display showing realtime RAM & CPU usage in corner of VDU, using osd_cat.
#!/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
#!/bin/sh
######################################
#> https://github.com/pystardust/ytfzf
######################################
YTFZF_VERSION="1.1.5"
############################
# Defaults #
@cirrusUK
cirrusUK / chunkdel
Created March 25, 2021 20:59
use fzf to list & delete chunk.io uploads
#!/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 March 25, 2021 20:59
use fzf to list chunk.io uploads
#!/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 March 25, 2021 18:27
fuzzy finder for gist
#!/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 January 31, 2023 04:14
mpv now playing uses libnotify (dunst) and osd_cat notify.lua calls mpvnp,notifies on startup and file change. mpv_osd
#!/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
#!/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=