Skip to content

Instantly share code, notes, and snippets.

@mark-lumbao
Created February 22, 2022 06:23
Show Gist options
  • Save mark-lumbao/6c488a6452991f701a0a7746c1a56eb7 to your computer and use it in GitHub Desktop.
Save mark-lumbao/6c488a6452991f701a0a7746c1a56eb7 to your computer and use it in GitHub Desktop.
DMenu helper for setting MSI Perkey RGB keyboard presets and colors
#!/bin/env bash
# TITLE: MSI-PERKEYRGB DMENU HELPER
# AUTHOR: Mark Anthony Lumbao
# DATE: 22 February, 2022
# DEPENDENCY: https://aur.archlinux.org/packages/msi-perkeyrgb
# Select a preset then hit ENTER
# To disable keyboard rgb just TYPE and ENTER "disable"
# To set a single color just TYPE and ENTER the HEX color value just make sure to start with #
option=$(msi-perkeyrgb --list-presets | grep - | xargs -I @ echo @ | cut -c 2- | dmenu -p "Select MSI preset")
head=$(echo $option | cut -c 1)
tail=$(echo $option | cut -c 2-)
if [ $option == "disable" ]
then
msi-perkeyrgb -d
elif [ $head == "#" ]
then
msi-perkeyrgb -s $tail
else
msi-perkeyrgb -p $option
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment