Skip to content

Instantly share code, notes, and snippets.

@sochotnicky
sochotnicky / sway_mark_urgent.py
Created September 7, 2021 14:23
sway_mark_urgent.py
#!/usr/bin/python3
import json
import logging
import subprocess
import sys
import psutil
# logging.basicConfig(filename="/tmp/swayurg.log", level=logging.DEBUG)
@sochotnicky
sochotnicky / test_nft.py
Last active September 1, 2021 14:33
test_nft.py
#!/usr/bin/python3
# Needs following to be run first:
# nft -f /usr/share/nftables/ipv4-filter.nft
data = {
"nftables": [
{"metainfo": {"json_schema_version": 1}},
{
"add": {
@sochotnicky
sochotnicky / binslack
Created August 22, 2021 14:10
bin/slack
#!/bin/sh
exec /usr/bin/slack --enable-features=UseOzonePlatform --ozone-platform=wayland
@sochotnicky
sochotnicky / tmpsway-run
Created August 18, 2021 16:56
/tmp/sway-run
#!/bin/sh
PATH="$HOME/bin:$PATH"
export SDL_AUDIODRIVER=pulse
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
@sochotnicky
sochotnicky / tmpsway-run
Created June 28, 2021 14:59
/tmp/sway-run
#!/bin/sh
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export SDL_VIDEODRIVER=wayland
# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
@sochotnicky
sochotnicky / recipes.org
Created April 1, 2021 19:14
recipes.org

Grilled Garlic Parmesan Chicken Wings

@sochotnicky
sochotnicky / stdin
Created March 27, 2021 10:48
stdin
#!/usr/bin/python3
import os
import json
import subprocess
import sys
import psutil
import logging
#logging.basicConfig(filename="/tmp/swayurg.log", level=logging.DEBUG)
@sochotnicky
sochotnicky / tmpwaybar-conf
Created March 27, 2021 09:35
/tmp/waybar-conf
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "pulseaudio", "cpu",
"memory", "temperature", "battery", "clock",
"sway/language", "tray"],
@sochotnicky
sochotnicky / stdin
Created March 27, 2021 09:33
stdin
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "pulseaudio", "cpu",
@sochotnicky
sochotnicky / homew0rmbinscreenshot
Created March 10, 2021 11:58
/home/w0rm/bin/screenshot
#!/bin/bash
if [ -z "$1" ]; then
echo "Need screenshot type (screen, window, selection) as argument"
exit 1
fi
case "$1" in
whole)
export IMG=~/Pictures/Screenshots/whole-$(date | sed 's/ /_/g;s/:/./g').png