Skip to content

Instantly share code, notes, and snippets.

@UndeadDevel
Last active January 29, 2024 19:52
Show Gist options
  • Save UndeadDevel/3ffeb19d66eee72c85d9c5a94ea2b60d to your computer and use it in GitHub Desktop.
Save UndeadDevel/3ffeb19d66eee72c85d9c5a94ea2b60d to your computer and use it in GitHub Desktop.
QubesOS: switch WiFi on and off via keyboard shortcut
#!/bin/bash
qvm-run sys-net -- "if nmcli radio wifi | head -c1 | grep -E 'e'; then nmcli radio wifi off; else nmcli radio wifi on; fi"
# If the file /var/lib/NetworkManager/NetworkManager.state with the following content is created in sys-net's template, then WiFi is off by default on boot:
# [main]
# NetworkingEnabled=true
# WirelessEnabled=false
# WWANEnabled=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment