Skip to content

Instantly share code, notes, and snippets.

@intrntbrn
intrntbrn / steam_menu.sh
Last active December 23, 2022 13:02
steam game launcher menu (dmenu, rofi, fzf) without desktop files
#!/bin/sh
dir="$HOME/.local/share/Steam/steamapps"
cmd="dmenu -i -p Steam"
find "$dir" -maxdepth 1 -type f -name '*.acf' -exec awk -F '"' '/"appid|name/{ printf $4 "|" } END { print "" }' {} \; | column -t -s '|' | sort -k 2 | $cmd | awk '{ print $1 }' | xargs -I {} steam steam://rungameid/{}
@intrntbrn
intrntbrn / resize-increment.c
Created May 21, 2021 18:14
set WM_NORMAL_HINTS program specified resize increment for any client (e.g. alacritty)
/*
* Author: intrntbrn
*
* Compile with:
* gcc resize-increment.c -Wall -o resize-increment `pkg-config --cflags --libs x11`
*
* Usage:
* resize-increment windowid width_inc height_inc
* e.g.: resize-increment 1234567 6 12
*/
@intrntbrn
intrntbrn / qutebrowser_export_html.sh
Last active March 5, 2021 17:24
generate a html startpage containing quickmarks, bookmarks and history from qutebrowser
#!/bin/bash
# qutebrowser_export_html.sh
# this script generates a simple html startpage for qutebrowser
# containing quickmarks, bookmarks and history.
print_usage() {
echo "Usage: $0 [-q quickmarks] [-b bookmarks] [-h history] [-l history-limit] [-o out] [-r]"
echo " -q specify quickmark file (default: ~/.config/qutebrowser/quickmarks)"
echo " -b specify bookmarks file (default: ~/.config/qutebrowser/bookmarks/urls)"
@intrntbrn
intrntbrn / fancy_taglist.lua
Last active March 29, 2024 09:20
awesomewm fancy_taglist: a taglist that contains a tasklist for each tag
-- awesomewm fancy_taglist: a taglist that contains a tasklist for each tag.
-- Usage:
-- 1. Save as "fancy_taglist.lua" in ~/.config/awesome
-- 2. Add a fancy_taglist for every screen:
-- awful.screen.connect_for_each_screen(function(s)
-- ...
-- local fancy_taglist = require("fancy_taglist")
-- s.mytaglist = fancy_taglist.new({
-- screen = s,
@intrntbrn
intrntbrn / virtual_keyboard.lua
Last active January 15, 2022 11:27
awesomewm virtual keyboard for tablet (hackable alpha version)
-- Dependency: xdotool
--
-- Usage:
-- 1. Save as "virtual_keyboard.lua" in ~/.config/awesome/
-- 2. Add a virtual_keyboard for every screen:
-- awful.screen.connect_for_each_screen(function(s)
-- ...
-- local virtual_keyboard = require("virtual_keyboard")
-- s.virtual_keyboard = virtual_keyboard:new({ screen = s } )
-- ...
@intrntbrn
intrntbrn / firefox_bookmarks
Created February 26, 2020 09:02
firefox bookmark menu (dmenu, rofi, fzf)
#!/bin/sh
# menu (dmenu, rofi, fzf, etc.)
menu_cmd='dmenu -i -p Bookmark'
# browser
browser_cmd='firefox --new-tab'
# in case the automatic profile detection does not work properly,
# replace <PROFILE> with your profile id (e.g. ik52yqxf.default-1574488801337) and uncomment
@intrntbrn
intrntbrn / chromium_bookmarks
Created February 26, 2020 09:00
chromium bookmark menu (dmenu, rofi, fzf)
#!/bin/sh
# menu (dmenu, rofi, fzf, etc.)
menu_cmd='dmenu -i -p Bookmark'
# browser
browser_cmd='chromium'
# bookmarks json file
bookmarks=~/.config/chromium/Default/Bookmarks