Skip to content

Instantly share code, notes, and snippets.

@kg333
kg333 / sunshine-output-fix.sh
Created March 13, 2026 20:44
A bash script fix for Fedora Linux and Sunshine on Nvidia drivers. Monitors sometimes change their numeration - this checks for a specific monitor and swaps the output if needed.
#!/bin/bash
SUNSHINE_CONFIG=/home/username/.config/sunshine/sunshine.conf
# read the currently configured monitor
outputmon=$(grep output_name $SUNSHINE_CONFIG | cut -d ' ' -f 3)
echo "Output monitor is $outputmon."
# read the log for the currently detected output for the DisplayPort
dpmon=$(journalctl --user -u sunshine | tac | grep -m 1 DP- | cut -d ' ' -f 10)
@kg333
kg333 / lovelace-migrate.py
Last active December 28, 2018 03:14 — forked from dale3h/lovelace-migrate.py
Lovelace UI Migration Script
"""
Migration tool for Home Assistant Lovelace UI.
"""
import argparse
import logging
import sys
import json
from collections import OrderedDict
from getpass import getpass