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

Border sizing can cause issues #12

Open
snide opened this issue Jun 22, 2020 · 9 comments
Open

Border sizing can cause issues #12

snide opened this issue Jun 22, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@snide
Copy link

snide commented Jun 22, 2020

First, thank you for this fantastic script! I was noticing issues when toggling in and out of zen mode, and noticed that the border and title would reappear when it snapped back in (losing the original border size).

I was able to fix this by removing the ZEN_BORDER overwrites and setting the DEFAULT_BORDER to my own pixel setting of for_window [class=".*"] border pixel 8

I don't know if this is something you'd wish to change, but figured I'd write it up in case others saw it. I'm happy to add a readme PR if you think it would be helpful to document. My guess though is by default the script should respect the border settings of the original i3 config.

@vrde vrde added the bug Something isn't working label Jun 23, 2020
@vrde
Copy link
Owner

vrde commented Jun 23, 2020

Hi, thanks for the issue! It sounds like a bug to me. i3-quiet should respect your settings, and not force any styling you didn't set.

DEFAULT_BORDER is used in case the file .config/i3/.i3-quiet.json is not found:

i3-quiet/quiet-cmd.py

Lines 55 to 59 in f4e8906

try:
with open(ZEN_FILE_PATH, 'r') as zen_file:
border = json.load(zen_file)['layout']['border']
except (FileNotFoundError, KeyError):
border = DEFAULT_BORDER

I've noticed a bug (that I forgot to report) related to this line here:

layout = check_output(['i3-save-tree', '--workspace', ZEN_WORKSPACE])

Basically, the i3-quiet script fails silently if i3-save-tree is not installed. When this happens the file .config/i3/.i3-quiet.json is not created and this might cause the issue you mentioned. Can you please check if you have it in your path by running which i3-save-tree? If you don't have the command installed, that might be the issue, and I need to fix the script so it doesn't silently fail.

@snide
Copy link
Author

snide commented Jun 23, 2020

I do have it installed. I can also verify that .config/i3/.i3-quiet.json does not exist on my machine. Yell if there's more I can help you with. I'm primarily a designer, so my python knowledge isn't going to be super strong for ya.

@vrde
Copy link
Owner

vrde commented Jun 23, 2020

I think I was able to reproduce the bug, I've recently updated to Ubuntu 20.04 and my i3-save-tree command doesn't work anymore.

If I run i3-save-tree in a terminal I get:

➜  ~ i3-save-tree 
Can't locate AnyEvent/I3.pm in @INC (you may need to install the AnyEvent::I3 module)(@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/bin/i3-save-tree line 19.
BEGIN failed--compilation aborted at /usr/bin/i3-save-tree line 19.

Do you get the same error by just running i3-save-tree?

@snide
Copy link
Author

snide commented Jun 23, 2020

Yep. I get that as well.

@vrde
Copy link
Owner

vrde commented Jun 23, 2020

OK, if you are on Ubuntu install libanyevent-i3-perl:

sudo apt install libanyevent-i3-perl

This should make i3-save-tree work. Not sure if it's a bug in the i3 package for Ubuntu, I'll dig into it. Until then, manually installing the package should fix your issue.

@snide
Copy link
Author

snide commented Jun 23, 2020

Can confirm that installing the package now makes i3-save-tree work. For any that might be lurking this issue, it's available on Pacman under a slightly different name https://www.archlinux.org/packages/community/any/perl-anyevent-i3/

I'll do some tests, reverting my hacks of your script to see how that fixes the inherited border settings. Thanks for the help and the wonderful package.

@snide
Copy link
Author

snide commented Jul 5, 2020

Sorry for the long wait on a response. Finally gave your default script a test with the packages installed. I still see the same issues when it returns back out of quiet mode.

Here's what I see in your script

image

Here's how it should be

image

Again, just a reminder, this isn't a blocker for me. Your script is simple enough I just edited it to not try and manage the border state. Just figured I'd post it up in case anyone else ran into similar problems.

Thanks so much for putting it on Github. I use it daily. As a person on an ultrawide monitor it's a huge win!

@vrde
Copy link
Owner

vrde commented Jul 8, 2020

Thanks for the update! I can try to play a bit with my border configuration to see if I can replicate your issue. Would you mind sharing with me your border config?

About this issue, is it something that happens because if i3-quiet? (I see we both use the Flameshot for screenshots :P)
image

Thanks so much for putting it on Github. I use it daily. As a person on an ultrawide monitor it's a huge win!

That's great to hear!

@snide
Copy link
Author

snide commented Jul 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants