Giter Site home page Giter Site logo

Comments (4)

fortydegrees avatar fortydegrees commented on June 18, 2024 5

This is a bug that will affect the M2 Air and Pro.

The option’s not being shown because Amphetamine is looking at the machine’s model identifier and seeing if it contains “Book” to check it’s a laptop.

For the M2 MacBook Pro and Air, Apple changed the model identifier to Mac14,7 and Mac14,2 respectively, so this lookup fails and the option doesn’t show.

When you select this option (if it shows), it adds and launches the cdm-manager plist file to launchctl, which when triggered, runs this script.

You can re-create this manually by copying the amphetamine-enhancer-cdmManager.plist to /Library/LaunchAgents and then running the following in terminal:

launchctl load -w /Library/LaunchAgents/amphetamine-enhancer-cdmManager.plist

launchctl start amphetamine-enhancer-cdmManager

That being said, I investigated this with the intention of making sure my M2 Air didn't sleep when on battery and connected to an external monitor, but this didn't work and my Air still goes to sleep. I think the way this is handled in M2 (and maybe M1) macs is different and so the CDM manager code just doesn't work.

I wanted this for battery preservation (to not leave it at 100% all the time), and so my eventual solution was just to keep the Macbook connect to charge, but to use AlDente to manage the battery.

from amphetamine-enhancer.

cani-venatici avatar cani-venatici commented on June 18, 2024 2

Mmm that's a bummer :/

My solution is run two bash scripts to switch on or off hibernation and sleep settings and enable clamshell mode without AC cable attached, independently from the app.

Run clam-sleep-off.sh to disable hibernation and sleep. This allows clamshell mode without AC ot happen basically..

Run clam-sleep-on.sh to restore default hib&sleep settings.

clam-sleep-off.sh

#!/usr/bin/env bash

#Disables sleep and hibernation
#allowing to use a second monitor with the lid closed

hib_mode="$(pmset -g | grep hibernatemode | grep -Eo "\d")"
sleep_mode="$(pmset -g | grep "\bsleep\b" | grep -Eo "\d")"
sleep_off="$(pmset -g | grep SleepDisabled | grep -Eo "\d")"

printf "\nRunning %s\n" "$0"

printf "The current hibernation mode is %s, default is 3 for Macbooks\n\n" "$hib_mode";


sudo pmset -a sleep 0 && printf "sleep set to %s\n" "$sleep_mode";

sudo pmset -a hibernatemode 0 && printf "hibernation mode set to %s\n" "$hib_mode";

sudo pmset -a disablesleep 1 && printf "SleepDisable is set to %s\n\n" "$sleep_off"

echo "Hibernation and sleep disabled. Clamsheel mode without AC activated"

clam-sleep-on.sh

#!/usr/bin/env bash

#Restores default settings for sleep and hibernation
#After running this script
#clamsheel mode requires the AC power connected to the mbpro

hib_mode="$(pmset -g | grep hibernatemode | grep -Eo "\d")"
sleep_mode="$(pmset -g | grep "\bsleep\b" | grep -Eo "\d")"
sleep_off="$(pmset -g | grep SleepDisabled | grep -Eo "\d")"

printf "\nRunning %s\n" "$0"

printf "The current hibernation mode is %s, default is 3 for Macbooks\n\n" "$hib_mode";


sudo pmset -a sleep 1 && printf "sleep set to %s\n" "$sleep_mode";

sudo pmset -a hibernatemode 3 && printf "hibernation mode set to %s\n" "$hib_mode";

sudo pmset -a disablesleep 0 && printf "SleepDisable is set to %s\n\n" "$sleep_off"

echo "Hibernation and sleep default settings restored"

from amphetamine-enhancer.

leahachase avatar leahachase commented on June 18, 2024 1

little update for anyone still looking for a solution, the developer quietly released an updated testflight build on their twitter that fixes this issue! the enhancer tool doesn’t have a testflight but it seems to work just fine without it so far.

from amphetamine-enhancer.

SensehacK avatar SensehacK commented on June 18, 2024

It kinda fixed it for me but again it appeared. Grayed out for me with the testflight build.

from amphetamine-enhancer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.