Skip to content

Instantly share code, notes, and snippets.

@vasi
Last active January 4, 2026 07:46
Show Gist options
  • Select an option

  • Save vasi/b9cf09423aecba6d036cc4eb9397086c to your computer and use it in GitHub Desktop.

Select an option

Save vasi/b9cf09423aecba6d036cc4eb9397086c to your computer and use it in GitHub Desktop.
Dynamically change the number of Compiz desktops #dalitrixie
#!/usr/bin/env python3
import sys
import compizconfig
if len(sys.argv) != 2:
print("Usage: dynamic-desktops [+N | -N]")
sys.exit(1)
change = int(sys.argv[1])
context = compizconfig.Context()
hsize = context.Plugins['core'].Screens[0]['hsize']
hsize.Value = max(1, hsize.Value + change)
context.Write()
#!/bin/sh
perl -i -pe 's/(?<=vwidth = )(\d+)/$1 + '$1' || 1/e' ~/.config/wayfire.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment