Skip to content

Instantly share code, notes, and snippets.

@SidharthArya
SidharthArya / alttab
Last active November 17, 2023 22:50
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python3
import sys
import json
import subprocess
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T')
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE)
data = json.loads(swaymsg.stdout)
current = data["nodes"][1]["current_workspace"]
@Darkhogg
Darkhogg / !RebootToOs.md
Last active May 1, 2024 20:38
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.