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 option to show marks instead of title #532

Merged
merged 1 commit into from
May 11, 2020
Merged

Conversation

ammgws
Copy link
Collaborator

@ammgws ammgws commented Jan 29, 2020

This can be merged once tmerr/i3ipc-rs/pull/51 has been implemented.

Solves #486

@ammgws ammgws force-pushed the addmarks branch 2 times, most recently from b90548a to 17c31cd Compare January 29, 2020 09:16
@ammgws ammgws changed the title [WIP] Add option to show marks instead of title Add option to show marks instead of title Jan 29, 2020
@travankor
Copy link
Contributor

travankor commented Feb 4, 2020

@ammgws
Sorry for not getting to this earlier, but this works well so far.

Something to consider: I only use 1 mark per window, but sway lets you have several marks per window if you do swaymsg mark [mark1] and swaymsg -- mark --add [mark2] . So maybe multiple marks should get enclosed in brackets like the header bar does?

Also some interesting info from the man page:

show_marks yes|no
           If show_marks is yes, marks will be displayed in the window
           borders.  Any mark that starts with an underscore will not be drawn
           even if show_marks is yes. The default is yes.

I'm not sure if i3status-rust should hide underscores. Marks are not shown by default and there might be unforeseen side effects.

@ammgws
Copy link
Collaborator Author

ammgws commented Feb 4, 2020

I can look into the multiple marks thing and an option to hide the underscored ones. However if the i3ipc crate is updated before that then we can just merge this simple implementation now and add those features later.

ammgws added a commit to ammgws/i3status-rust that referenced this pull request May 11, 2020
…indow block,

and a sway driver for the keyboard_layout block. sway IPC is built on top of i3 IPC,
so anything that works in i3 also works in sway. However with this crate we can
access sway-only parts of the IPC such as the keyboard layout. Also, the maintainer
for i3ipc-rs seems to be AWOL at the moment which is stalling greshake#532
ammgws added a commit to ammgws/i3status-rust that referenced this pull request May 11, 2020
This allows future work such as adding marks support to the focused_window block,
and a sway driver for the keyboard_layout block. sway IPC is built on top of i3 IPC,
so anything that works in i3 also works in sway. However with this crate we can
access sway-only parts of the IPC such as the keyboard layout. Also, the maintainer
for i3ipc-rs seems to be AWOL at the moment which is stalling greshake#532
@ammgws
Copy link
Collaborator Author

ammgws commented May 11, 2020

@travankor this is now implemented using the swayipc-rs crate. It works fine for me, please let me know if there are any issues.

@ammgws ammgws merged commit c35032b into greshake:master May 11, 2020
@ammgws ammgws deleted the addmarks branch May 11, 2020 17:02
@travankor
Copy link
Contributor

@ammgws seems like it works well but the issues raised here remain.

Also the binary size has gone up a significant bit since the last release -- from 6M to 11M.

@ammgws
Copy link
Collaborator Author

ammgws commented May 12, 2020

So with one mark set, e.g. "abc", the bar should display: "abc"

And with multiple marks set, e.g. "abc" and "def", the bar should display: "[abc] [def]"

?

If the binary size is a problem then I will have to look into later. Perhaps enabling LTO could help. Do you mean last release as in the last tagged version vs git master?

@travankor
Copy link
Contributor

travankor commented May 12, 2020

@ammgws

So with one mark set, e.g. "abc", the bar should display: "abc"
And with multiple marks set, e.g. "abc" and "def", the bar should display: "[abc] [def]"

  1. Currently multiple marks get concatenated, and it looks like one giant mark. swaymsg -- mark --add anothermark for example.

  2. Marks that begin with underscores are considered hidden by i3/sway.

Do you mean last release as in the last tagged version vs git master?

Yes. It's not a problem for me personally; I just noticed this and wanted to report it.

@ammgws
Copy link
Collaborator Author

ammgws commented May 12, 2020

Currently multiple marks get concatenated, and it looks like one giant mark. swaymsg -- mark --add anothermark for example.

I don't use marks so I wasn't sure what it looked like in the first place. This is what one mark and two marks looks like for me:
image

I was thinking about making i3status-rust show multiple marks with brackets around each one like sway does, but looks like sway does it for the singular case as well so I guess I will change that too.

@ammgws
Copy link
Collaborator Author

ammgws commented May 13, 2020

Also the binary size has gone up a significant bit since the last release -- from 6M to 11M.

FYI enabling link time optimizations brings it down to 8.6MB

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.

3 participants