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

river: predefine tags for app-id and title #696

Closed
wants to merge 2 commits into from

Conversation

choelzl
Copy link

@choelzl choelzl commented Sep 17, 2022

Related issues: #201 #472

This PR adds a command to riverctl. The objective being to pre-define tags for app-id's and titles (similarly to how it is done for floating).

Usage example: riverctl spawn-tags-filter app-id "kitty" 4

@@ -171,6 +175,30 @@ pub fn shouldFloat(self: Self, view: *View) bool {
return false;
}

pub fn getSpawnTagsFilter(self: Self, view: *View) u32 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn getSpawnTagsFilter(self: Self, view: *View) u32 {
pub fn getSpawnTagsFilter(self: Self, view: *View) ?u32 {

Return tags if found, null if not.

@@ -494,6 +494,9 @@ pub fn map(self: *Self) !void {
if (self.getTitle()) |s| handle.setTitle(s);
if (self.getAppId()) |s| handle.setAppId(s);

self.pending.tags = server.config.getSpawnTagsFilter(self);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.pending.tags = server.config.getSpawnTagsFilter(self);
if (server.config.getSpawnTagsFilter(self)) |tags| self.pending.tags = tags;

Initial tags are set in .init()

@sfrique

This comment was marked as spam.

@HenkVanMaanen
Copy link

Interested too in this feature!

@ifreund
Copy link
Member

ifreund commented Mar 27, 2023

This patch has grown significant conflicts due to the introduction of the rules system.

Now that the rules system has been fleshed out I would be willing to accept a patch adding an action type to set initial tags.

@ifreund ifreund closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants