Krolyxon
Commit c183b88

Branches

Refs →

aurora.localbinenvyswitch

21 lines · 554 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
13# hybrid: --rtd3 lets the dGPU power off when idle
14set -- -s "$arg"
15[ "$arg" = hybrid ] && set -- "$@" --rtd3
16
17if sudo -A envycontrol "$@"; then
18 notify-send "Graphics mode set to $mode"
19else
20 notify-send "Failed to set graphics mode to $mode"
21fi