-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "reverse speed" setting #44
Add "reverse speed" setting #44
Conversation
e8ab9ee
to
1c1a468
Compare
Hello, @jakob30061! Thank you for the contribution! |
Hello, |
Sure |
1c1a468
to
f9617a8
Compare
I resolved the conflicts and updated the code for this feature. Maybe you could check the Russian translation :) |
po/ru.po
Outdated
@@ -62,32 +62,36 @@ msgstr "Только проценты" | |||
msgid "Character only" | |||
msgstr "Только персонаж" | |||
|
|||
#: src/resources/ui/preferences.ui:51 | |||
#: src/resources/ui/preferences.ui:49 | |||
msgid "Reverse speed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be clearer to name this setting Invert running speed
'?
I'm not a native speaker, but doesn't Reverse speed
sound like the cat would run backwards?
msgid "Invert running speed"
msgstr "Инвертировать скорость"
src/indicator.js
Outdated
@@ -112,14 +118,17 @@ export default class RunCatIndicator extends PanelMenuButton { | |||
|
|||
repaintUi() { | |||
/** @type {CharacterState} */ | |||
const characterState = this.#data?.cpu > this.#settings.idleThreshold ? 'active' : 'idle' | |||
const isActive = this.#data?.cpu > this.#settings.idleThreshold || this.#settings.reverseSpeed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that idleThreshold
is not compatible with invertRunningSpeed
setting. If utilization is 100%, it makes it harder for the cat to run, but it would be weird if it fell asleep :D WDYT?
If you agree with statement above, you could do something like:
let utilization = this.#data?.cpu
let isActive = this.#data?.cpu > this.#settings.idleThreshold
if (this.#settings.invertRunningSpeed) {
utilization = 100 - utilization
isActive = true
}
And that's it. But you have to update settings UI, see the next comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope i'm not mistaken, but this const isActive = this.#data?.cpu > this.#settings.idleThreshold || this.#settings.invertRunningSpeed
should ignore the idleThreshold
setting if invertRunningSpeed
is active.
So the cat isn't sleeping, despite a idleThreshold value greater than 0.
@@ -43,6 +43,18 @@ | |||
</property> | |||
</object> | |||
</child> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to lock idle threshold settings if invert-running-speed
is enabled.
Example: https://github.com/aunetx/blur-my-shell/blob/30459d58d303595b198711c5d6ebc03a5006fd87/resources/ui/dash.ui#L53
Ping me if you need an assistance with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Before you could change the idle threshold setting but nothing would happen.
This didn't work, cause i needed the inverted the behavior.
@jakob30061: I need some time to test the feature manually |
Hey, |
2ec7843
into
win0err:feature/invert-characters-speed
@jakob30061: I've merged to the dev branch and refactored code (see commit 871740e). Thank you for your work and patience! I plan to add one more feature (#52) and release a new version. Dev branch: feature/v27 |
* Add setting to schema * Add functionality for reverse speed * Update translation files * Rename reverse-speed to invert-running-speed * Lock idleThreshold if reverseRunningSpeed is active
Hey Sergei,
After show this awesome extension to a friend, who is a mac user, he installed the mac version of this tool.
Their where some settings, customizing the cat. (changing sprites, other stats like gpu use, etc.)
One setting i found really useful, was having the cat sprinting most of the time and running "laggy" when the cpu usage was higher.
Not that is make sense, but it looks fun.
I added a setting and reverse the animation timeout.
New switch in settings:
![image](https://private-user-images.githubusercontent.com/72307968/238145236-4607330c-5218-4cf7-9216-ac15c1861ace.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExODc4OTQsIm5iZiI6MTcyMTE4NzU5NCwicGF0aCI6Ii83MjMwNzk2OC8yMzgxNDUyMzYtNDYwNzMzMGMtNTIxOC00Y2Y3LTkyMTYtYWMxNWMxODYxYWNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDAzMzk1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiZGU0NDdlMTUxMWQ2MDc5NzliYWRhOWEwMzBmYjMyYTFiMDI3Y2ZlMzJkOTY5YzcwZjQ5NmQ4MDc2ZGNhYjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4mYRDnmVeVW0ceZPvuiw1Uk_TqJ6A7NVu7fodTpKc98)