Re: Points vs pixels in a bash script
Re: Points vs pixels in a bash script
- Subject: Re: Points vs pixels in a bash script
- From: Ken Thomases via Cocoa-dev <email@hidden>
- Date: Wed, 10 Jun 2020 15:52:02 -0500
On Jun 9, 2020, at 8:11 AM, Gabriel Zachmann <email@hidden> wrote:
>
>> In particular, you're not taking into account the current screen resolution
>> (a.k.a. display mode). The user can select different scaling for a Retina
>> display in System Preferences > Displays.
>
> Good point.
> I wasn't taking that into consideration.
>
> So, what would be a robust way to determine whether or not a window (as
> reported by "System Events") has a fullscreen size?
>
> Or is there another way to determine whether or not an app is in fullscreen?
>
>> First, you're going to have to explain exactly what you're planning to do
>> with the results of your calculation. Do you really want the physical
>> screen size? Or do you want the size of the
>
> I only want to have a little shell script
> (or other little utility ) that runs inconspicuously in the background (or in
> the top right menu bar) and launches a specific app once the user has been
> inactive for a while,
> UNLESS there is another app running at the moment in fullscreen.
>
> Does anyone have some code they could share?
You could do, for example:
python -c 'import AppKit ; print
AppKit.NSScreen.screens()[0].frame().size.width'
Similarly for height.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden