Skip to content

Instantly share code, notes, and snippets.

View thingsiplay's full-sized avatar

Tuncay thingsiplay

View GitHub Profile
@thingsiplay
thingsiplay / flatapp
Last active April 11, 2024 12:16
Run Flatpak apps by search filter or through fuzzy finder menu
#!/usr/bin/env bash
# Show info and run flatpak apps with fzf
# flatapp [arguments]
flatpak_preview() {
app="$(echo "${1}" | awk -F'\t' '{print $2}')"
flatpak info "${app}"
}
export -f flatpak_preview
@thingsiplay
thingsiplay / _output_example_Arcade Games_missing.txt
Last active April 8, 2024 21:21
Compare two RetroArch .lpl playlist files and find missing titles
'L' Of A Day
005
007: GoldenEye
025D2
025K2
025R2
1 on 1 Government
10 Jeux Interactifs / Jeux Pour Filles
10 X 10
100 in 1
@thingsiplay
thingsiplay / yayqp
Created March 25, 2024 03:53
yay query preview
#!/bin/env bash
yay_preview() {
yay -Qqil "${1}"
}
export -f yay_preview
yay_preview_output() {
yay_preview "${1}" | less
@thingsiplay
thingsiplay / loop.sh
Created March 24, 2024 23:40
Run a command n-times or infinite times.
#!/usr/bin/env bash
# Run a command n-times or infinite times.
# by Tuncay D. (thingsiplay)
#
# Usage: loop [N] COMMAND
#
# If the first argument N is a number, then it will run the command that many
# times. If N is not a number, then it will be interpreted as part of the
# actual command and run indefinitely.
@thingsiplay
thingsiplay / checkupdateslist
Last active March 17, 2024 18:28
Check Updates List for Archlinux using checkupdates
#!/bin/env bash
# Check Updates List
# Report and notify only when specific packages needs an update on Archlinux.
#
# Usage:
# checkupdateslist [package]...
#
# Example:
# $ checkupdateslist
@thingsiplay
thingsiplay / woman
Last active June 8, 2023 04:22
woman - Preview list for man documents
#!/bin/env bash
# Lookup section meaning in `man man`.
sections='1,8,6,5,7'
show_manual () {
man -- "${1%% *}" 2> /dev/null
}
export -f show_manual
@thingsiplay
thingsiplay / save ()
Last active May 31, 2023 11:06
save - Capture and reuse output of command (Bash function)
# save - Capture and reuse output of command
# A Bash function
#
# usage: save [file]
#
# On start of the Bash session a new temporary file is created that lives as
# long as this terminal session lives. This is the default file. It's path can
# be looked up in the environmental variable $SAVE. Anytime `save` runs, it
# will lookup this variable. The first argument to `save` is a file path that
# will be used as $SAVE file. A manual set file won't be deleted automatically.
@thingsiplay
thingsiplay / scalefx_plus.slangp
Created May 4, 2023 02:51
RetroArch: Scalefx Shader Presets
shaders = "22"
feedback_pass = "0"
shader0 = "shaders_slang/stock.slang"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = "mdapt_refpass"
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
shader1 = "shaders_slang/dithering/shaders/mdapt/passes/mdapt-pass0.slang"
filter_linear1 = "false"
@thingsiplay
thingsiplay / ?
Last active June 3, 2023 13:23
cheat.sh - The only cheat sheet you need
#!/bin/env bash
cheat='curl -s cheat.sh'
menu='fzf --reverse'
pager='less -R -c'
cachefile_max_age_hours=6
# Path to temporary cache file. If your Linux system does not support /dev/shm
# or if you are on MacOS, then change the path to your liking:
cachefile='/dev/shm/cheatlist' # GNU+LINUX
@thingsiplay
thingsiplay / qforceupdate
Last active February 26, 2024 11:24
qforceupdate - update a widget on your bar through shell command
#!/bin/env bash
# Usage:
# qforceupdate
# qforceupdate checkupdates
if [ "${#}" == 0 ]
then
# requires ln -s ~/.cache/qtile/qtilesocket.\:0 ~/.cache/qtile/qtilesocket.\:0.0
qtile cmd-obj -o cmd -f list_widgets \