this post was submitted on 03 Jun 2024
31 points (97.0% liked)

Android

27897 readers
305 users here now

DROID DOES

Welcome to the droidymcdroidface-iest, Lemmyest (Lemmiest), test, bestest, phoniest, pluckiest, snarkiest, and spiciest Android community on Lemmy (Do not respond)! Here you can participate in amazing discussions and events relating to all things Android.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules


1. All posts must be relevant to Android devices/operating system.


2. Posts cannot be illegal or NSFW material.


3. No spam, self promotion, or upvote farming. Sources engaging in these behavior will be added to the Blacklist.


4. Non-whitelisted bots will be banned.


5. Engage respectfully: Harassment, flamebaiting, bad faith engagement, or agenda posting will result in your posts being removed. Excessive violations will result in temporary or permanent ban, depending on severity.


6. Memes are not allowed to be posts, but are allowed in the comments.


7. Posts from clickbait sources are heavily discouraged. Please de-clickbait titles if it needs to be submitted.


8. Submission statements of any length composed of your own thoughts inside the post text field are mandatory for any microblog posts, and are optional but recommended for article/image/video posts.


Community Resources:


We are Android girls*,

In our Lemmy.world.

The back is plastic,

It's fantastic.

*Well, not just girls: people of all gender identities are welcomed here.


Our Partner Communities:

!android@lemmy.ml


founded 1 year ago
MODERATORS
 

So I have Tasker and I'm a total novice with it.

I'd like to create a simple task that shows the auto-rotate icon in my status bar when auto-rotate is on. Then when it's turned back off, make the icon disappear.

Any help would be greatly appreciated!

top 10 comments
sorted by: hot top controversial new old
[–] Wistful@discuss.tchncs.de 5 points 5 months ago

I think the only way to show the icon on the status bar with tasker is using the notification (notify task) and giving it an icon.

     Profile: Detect Auto-rotation setting change
    	Event: Custom Setting [ Type:System Name:accelerometer_rotation Value:* ]
    
    
    
    Enter Task: Un-notify if autorotate off
    
    A1: Custom Setting [
         Type: System
         Name: accelerometer_rotation
         Read Setting To: %arstat ]
    
    A2: Notify Cancel [
         Title: ar ]
        If  [ %arstat ~ 0 ]
    
    A3: Notify [
         Title: ar
         Icon: mw_device_screen_rotation
         Number: 0
         Priority: 3
         LED Colour: Red
         LED Rate: 0 ]
        If  [ %arstat ~ 1 ]
    
       

You can set the notification to silent.

[–] _g_be@lemmy.world 3 points 5 months ago (1 children)

I've used something called "System UI Tuner" in the past. It does what you ask, in that you can modify which status car icons are shown, amongst other things.

Haven't tried it recently, not sure it still exists or works with newer versions of Android.

[–] thequantumcog@lemmy.world 1 points 5 months ago

It still works for AOSP and AOSP-Like Roms but doesn't work for OP on OneUI

[–] thequantumcog@lemmy.world 2 points 5 months ago (1 children)

No need for tasker, you can achieve the same thing by enabling rotation icon using systemui tuner and adb.

[–] AFC1886VCC@reddthat.com 1 points 5 months ago

I tried systemui tuner and it doesn't work sadly. OneUI doesn't natively show the rotation icon in the status bar so I was trying to enable something that didn't exist. That's my theory anyway :)

That's why I've been trying to do it with tasker

[–] CameronDev@programming.dev 1 points 5 months ago* (last edited 5 months ago) (1 children)

I had a quick look, and cant find a way to detect the auto rotate state.

What is your end goal out of curiosity? Do you juat want to have a visual notification of autorotate so you can turn it off? Because an alternative would be to automatically turn it on and off.

I use this:

https://taskernet.com/shares/?user=AS35m8n8aLszGBR%2Bqb%2FvaUMEVX6DHjPZv%2Ba%2F8L3D6HkyQQ%2FGVLhuUeN3Uhf03S5c%2FtdJpZye&id=Profile%3AAutoRotate

When in YouTube, Netflix, etc, it enables autorotate, and when you switch out it disables it again.

[–] AFC1886VCC@reddthat.com 1 points 5 months ago (1 children)

I'm just looking for a visual cue that auto rotate is toggled on or off. Sometimes I lay down sideways and I forget that my auto rotate is on so I have to physically turn my phone around to get back to portrait mode. I know it's silly really but my Samsung phone doesn't have an option to display the rotation lock status in the status bar.

Thanks for the suggestion.

[–] CameronDev@programming.dev 2 points 5 months ago* (last edited 5 months ago)

Maybe try the state->custom setting thing? For some reason I cant find the autorotate setting on my phone :/

There are apps for screen rotation: https://play.google.com/store/apps/details?id=org.crape.rotationcontrol

Perhaps that will do what you want?

[–] catloaf@lemm.ee 1 points 5 months ago

I found a way to get/set autorotation: https://stackoverflow.com/questions/25864385/changing-android-device-orientation-with-adb

Change "put" to "get" to query.

I don't know about adding icons. Perhaps it would be acceptable to just always set autorotate off at a certain time, or when you get home?

Personally, I almost always just keep it off, and on the rare occasion I have it on and forget, I just turn it off while my phone is rotated, and it goes back to portrait mode.

[–] solidgrue@lemmy.world 0 points 5 months ago* (last edited 5 months ago)

I also mainly don't use screen Auto Rotate, but I did make it a tile on the window shade. Rather than toggle it manually, I have Tasker enable rotation when an app that I want to auto-rotate is active on the screen, and disable it when that app is not active.

It doesn't put anything up on the status bar, but if you can live without it knowing only certain apps do it, maybe it doesn't matter.

    Profile: Auto-rotate Apps
    Settings: Restore: yes
    	Application: Sky Map, Camera, Gallery...
    
    
    
    Enter Task: Enable Auto-rotate
    
    A1: Display AutoRotate [
         Set: On ]
        If  [ %ROTATE_APP_LOCK Set ]
    
    A2: Variable Clear [
         Name: %ROTATE_APP_LOCK ]
    
    
    
    Exit Task: Disable Auto-rotate
    
    A1: Variable Set [
         Name: %ROTATE_APP_LOCK
         To: 1 ]
        If  [ %ROTATE_APP_LOCK !Set ]
    
    A2: Display AutoRotate [ ]