mirror of
https://github.com/aljazceru/omakub.git
synced 2026-01-26 07:14:21 +01:00
Merge pull request #384 from basecamp/asdcontrol
Add ASDControl to set Apple Studio and XDR display brightness from cli
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
CHOICES=(
|
||||
"Dev Language Install programming language environment"
|
||||
"Dev Database Install development database in Docker"
|
||||
"1password Manage your passwords securely across devices"
|
||||
"Audacity Record and edit audio"
|
||||
"Brave Chrome-based browser with built-in ad blocking"
|
||||
"Cursor The AI Code Editor"
|
||||
"Doom Emacs Emacs framework with curated list of packages"
|
||||
"Dropbox Sync files across computers with ease"
|
||||
"OBS Studio Record screencasts with inputs from both display + webcam"
|
||||
"Ollama Run LLMs, like Meta's Llama3, locally"
|
||||
"RubyMine IntelliJ's commercial Ruby editor"
|
||||
"Spotify Stream music from the world's most popular service"
|
||||
"Steam Play games from Valve's store"
|
||||
"VirtualBox Virtual machines to run Windows/Linux"
|
||||
"Zed Fast all-purpose editor"
|
||||
"Zoom Attend and host video chat meetings"
|
||||
"> All Re-run any of the default installers"
|
||||
"<< Back "
|
||||
"Dev Language Install programming language environment"
|
||||
"Dev Database Install development database in Docker"
|
||||
"1password Manage your passwords securely across devices"
|
||||
"Audacity Record and edit audio"
|
||||
"ASDControl Set brightness on Apple Studio and XDR displays via cli"
|
||||
"Brave Chrome-based browser with built-in ad blocking"
|
||||
"Cursor The AI Code Editor"
|
||||
"Doom Emacs Emacs framework with curated list of packages"
|
||||
"Dropbox Sync files across computers with ease"
|
||||
"OBS Studio Record screencasts with inputs from both display + webcam"
|
||||
"Ollama Run LLMs, like Meta's Llama3, locally"
|
||||
"RubyMine IntelliJ's commercial Ruby editor"
|
||||
"Spotify Stream music from the world's most popular service"
|
||||
"Steam Play games from Valve's store"
|
||||
"VirtualBox Virtual machines to run Windows/Linux"
|
||||
"Zed Fast all-purpose editor"
|
||||
"Zoom Attend and host video chat meetings"
|
||||
"> All Re-run any of the default installers"
|
||||
"<< Back "
|
||||
)
|
||||
|
||||
CHOICE=$(gum choose "${CHOICES[@]}" --height 19 --header "Install application")
|
||||
CHOICE=$(gum choose "${CHOICES[@]}" --height 20 --header "Install application")
|
||||
|
||||
if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then
|
||||
# Don't install anything
|
||||
|
||||
@@ -36,3 +36,14 @@ webm2mp4() {
|
||||
output_file="${input_file%.webm}.mp4"
|
||||
ffmpeg -i "$input_file" -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 192k "$output_file"
|
||||
}
|
||||
|
||||
# Allow brightness controls if ASDControl is installed
|
||||
if [ -f "/usr/local/bin/asdcontrol" ]; then
|
||||
export APPLE_DISPLAY_DEV=$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | sed -n 's|^\(/dev/usb/hiddev[0-9]*\):.*|\1|p')
|
||||
|
||||
alias brup="asdcontrol $APPLE_DISPLAY_DEV -- +10000"
|
||||
alias brdown="asdcontrol $APPLE_DISPLAY_DEV -- -10000"
|
||||
|
||||
alias brmax="asdcontrol $APPLE_DISPLAY_DEV -- +60000"
|
||||
alias brmin="asdcontrol $APPLE_DISPLAY_DEV -- -60000"
|
||||
fi
|
||||
|
||||
15
install/desktop/optional/app-asdcontrol.sh
Normal file
15
install/desktop/optional/app-asdcontrol.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
# Install asdcontrol
|
||||
git clone https://github.com/nikosdion/asdcontrol.git /tmp/asdcontrol
|
||||
cd /tmp/asdcontrol
|
||||
make
|
||||
sudo make install
|
||||
cd -
|
||||
rm -rf /tmp/asdcontrol
|
||||
|
||||
# Setup sudo-less controls
|
||||
echo 'KERNEL=="hiddev*", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="9243", GROUP="users", OWNER="root", MODE="0660"' | sudo tee /etc/udev/rules.d/50-apple-xdr.rules >/dev/null
|
||||
echo 'KERNEL=="hiddev*", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1114", GROUP="users", OWNER="root", MODE="0660"' | sudo tee /etc/udev/rules.d/50-apple-studio.rules >/dev/null
|
||||
sudo udevadm control --reload-rules
|
||||
|
||||
# Reboot to pickup changes
|
||||
gum confirm "Ready to reboot for brightness controls to be available?" && sudo reboot
|
||||
Reference in New Issue
Block a user