Skip to content

Instantly share code, notes, and snippets.

@97-109-107
97-109-107 / i3-get-current-screen.py
Last active September 19, 2019 15:46
get the size of current screen in i3wm
#!/usr/bin/env python
import i3
def getCurrentScreen():
workspace = [ws for ws in i3.get_workspaces() if ws['focused']][0]
screen_w =str(workspace['rect']['width'])
screen_h =str(workspace['rect']['height'])
print(screen_w, screen_h);
#!/bin/bash
i3-msg -t get_workspaces | jq -r 'map(select(.focused))[0].rect["width","height"]'
i3-msg -t get_workspaces | jq -r 'map(select(.focused))[0].output'
*background: #1e2132
*foreground: #c6c8d1
! black
*color0: #2a3158
*color8: #444b71
! red
*color1: #e27878
*color9: #e2a478
! green
*color2: #89b8c2
@97-109-107
97-109-107 / tile-setter.sh
Last active March 31, 2023 22:46
Aids in setting stupid tiles as X11 background; tints and tiles;
#!/bin/sh
# ██ ██ ██ ██ ██
# ░██ ░░ ░██ ░██ ░██
# ██████ ██ ░██ █████ ██████ █████ ██████ ██████ █████ ██████
# ░░░██░ ░██ ░██ ██░░░██ █████ ██░░░░ ██░░░██░░░██░ ░░░██░ ██░░░██░░██░░█
# ░██ ░██ ░██░███████░░░░░ ░░█████ ░███████ ░██ ░██ ░███████ ░██ ░
# ░██ ░██ ░██░██░░░░ ░░░░░██░██░░░░ ░██ ░██ ░██░░░░ ░██
# ░░██ ░██ ███░░██████ ██████ ░░██████ ░░██ ░░██ ░░██████░███
# ░░ ░░ ░░░ ░░░░░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░░░░░ ░░░
# Aids in setting stupid tiles as X11 background; tints and tiles;
@97-109-107
97-109-107 / openrct-scr.sh
Created July 10, 2016 15:54
Creates openrct2 scenario screenshots
#!/bin/sh
find ~/.config/OpenRCT2/Scenarios/ -iname "*sc6" -print0 | while IFS= read -r -d '' path; do
name=$(basename "$path")
$(openrct2 screenshot "$path" /tmp/Scenarios/"$name".png 1024 1024 0 50 3 0)
done