Skip to content

Instantly share code, notes, and snippets.

@binarynoise
binarynoise / Readme.md
Last active September 18, 2023 14:52
Kitty Theme Listener

Automatically make kitty toggle between light and dark themes to follow the theme you set. Just put it into autostart.

@binarynoise
binarynoise / vnc-server.sh
Created August 29, 2022 14:39
Virtual Display VNC-Server
#!/bin/bash
# https://github.com/dianariyanto/virtual-display-linux/
# https://bbs.archlinux.org/viewtopic.php?id=180904
# https://unix.stackexchange.com/questions/378373/add-virtual-output-to-xorg
set -euo pipefail
set -x
resolution="1920x1080"
screen="HDMI-2"
@Throws(IllegalStateException::class)
private fun saveImageToDisk(bitmap: Bitmap) {
val fileName = "..."
if (Build.VERSION.SDK_INT < 29) {
val canWriteStorage =
Build.VERSION.SDK_INT < 23 || checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
check(canWriteStorage) { "no storage permission" }
val directory = pictureFolder