Skip to content
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 kdeconnect block #717

Merged
merged 1 commit into from
Jun 2, 2020
Merged

Add kdeconnect block #717

merged 1 commit into from
Jun 2, 2020

Conversation

ammgws
Copy link
Collaborator

@ammgws ammgws commented Jun 1, 2020

Testers welcome!

@GladOSkar
Copy link
Contributor

GladOSkar commented Jun 1, 2020

Works beautifully! Awesome idea :)

image

Although personally, i don't really care about my phone's charge state (it always lasts the day) but only the notification count. Could we have the icon and state/color criteria changeable?

The mobile-android fontawesome icon or similar is probably better suited anyway

@ammgws
Copy link
Collaborator Author

ammgws commented Jun 1, 2020

Yeah I'll change it so icons are specified via the format string instead, I think that should work. How should the state/colour work with notifications? Also does yours ever show anything but 0?

@GladOSkar
Copy link
Contributor

I'd probably set it to info whenever there are any notifications, and default otherwise.

Actually, now that you mention it, the notification counter doesn't seem to update in place. When i reload the bar though, it does show:

image

@ammgws
Copy link
Collaborator Author

ammgws commented Jun 1, 2020

Oh I think I forgot to add the handler for notifications. Oops! I'll do it sometime this week

@ammgws ammgws force-pushed the kdeconnect branch 4 times, most recently from 2edb495 to db3c509 Compare June 2, 2020 13:53
@ammgws
Copy link
Collaborator Author

ammgws commented Jun 2, 2020

Updated.

  • notifications now update
  • changed block icon to a phone
  • made battery and notification icons selectable as qualifiers for the format string
  • block state can be set to act on notifications instead of battery by setting all the thresholds to 0

I think that it should be OK to merge now as the basic functionality appears to be working fine. Probably need more people to test it anyway.

@ammgws ammgws force-pushed the kdeconnect branch 2 times, most recently from b169f0f to 9267629 Compare June 2, 2020 14:10
@GladOSkar
Copy link
Contributor

GladOSkar commented Jun 2, 2020

Works great! Thanks!

block state can be set to act on notifications instead of battery by setting all the thresholds to 0

This feels a little hacky but if it works ¯\_(ツ)_/¯. I'd recommend adding it to the block documentation as well though.

@ammgws
Copy link
Collaborator Author

ammgws commented Jun 2, 2020

Yeah it's what I went up with now since the other thing was to separate the block into widgets which would then mean multiple format strings are needed. IIRC other blocks with configurable state thresholds act similarly: if you set them all to 0 then block state won't be set at all.

@ammgws ammgws merged commit 4e0e538 into greshake:master Jun 2, 2020
@ammgws ammgws deleted the kdeconnect branch June 2, 2020 14:38
@GladOSkar
Copy link
Contributor

Ok yeah then that makes sense. I originally thought of another config option but that's probably way more bloat than necessary

@GladOSkar
Copy link
Contributor

OK i found another Problem: The bar crashes when my device isn't connected.

image

@ammgws
Copy link
Collaborator Author

ammgws commented Jun 3, 2020

Ah I was waiting for that to come up. Is that when you start the bar before connecting your phone, or does it happen if you disconnect your phone after successfully starting the bar? Somehow I haven't managed to trigger it but I guess my VPN has kept it's connection this whole time.

Edit: Actually going by that error message I think that one can only occur during startup. Maybe we can display a "disconnected" icon and then periodically check for it to come online.

@GladOSkar
Copy link
Contributor

GladOSkar commented Jun 3, 2020

Well my usecase is that i take this computer lots of places, and only sometimes (at home) are both devices on the same subnet. At university, work, or a friend's place, either

a) The network does not allow communication between devices or
b) My phone isn't on wifi and therefore not on the same network

I only saw it while starting the computer+bar as of yet, but when i'm home i can test what happens when i disconnect the phone from wifi

@ammgws
Copy link
Collaborator Author

ammgws commented Jun 3, 2020

I turned my VPN and WiFi off before heading home and found that the bar was still alive, albeit the kdeconnect block was static with the last seen values. As soon as I connected my phone to the network the block updated again.

Things to try:

  1. Show phone as disconnected when it goes away (I think there are some signals on the bus I can watch for this)
  2. Figure out what do to with the startup case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants