Krolyxon
Commit bf9a79c

Branches

Refs →

aurora.localbinenvyswitch

17 lines · 448 B · Bourne Again Shell (bash)

1#!/bin/env bash
2
3mode="$(printf "Integrated\nHybrid\nNvidia" | aurora-run --dmenu -p "Select the graphics mode:")"
4
5# Exit if no selection was made
6[ -z "$mode" ] && exit 1
7
8notify-send "Switching to $mode mode..."
9
10# Map mode to envycontrol argument
11arg=$(echo "$mode" | tr '[:upper:]' '[:lower:]')
12
13if sudo -A envycontrol -s "$arg"; then
14 notify-send "Graphics mode set to $mode"
15else
16 notify-send "Failed to set graphics mode to $mode"
17fi