FelixKratz / JankyBorders

A lightweight window border system for macOS
GNU General Public License v3.0
1k stars 18 forks source link

Blacklist not working on applications with a space #47

Closed CampAsAChamp closed 7 months ago

CampAsAChamp commented 8 months ago

I'm trying to add "IntelliJ IDEA" to the blacklist but having no luck since I'm guessing the spaces are the problem. When I add "Safari" or "iTerm2" it works just as expected and prevents them from getting borders.

I tried using single quotes, as well as escaping the spaces with \ (ex: "blacklist="IntelliJ\ IDEA") but that didn't seem to work either.

Am I using it incorrectly?


bordersrc file šŸ‘‡

#!/bin/bash

options=(
    style=round
    width=5.0
    hidpi=on
    active_color=0xffc678dd
    inactive_color=0xff414550
    blacklist="'IntelliJ IDEA'"
)

borders "${options[@]}"

Note: I looked into the code and saw the window_in_list() function looks to be the one checking this by calling proc_name() but I'm not familiar with Objective-C to know how that works or how to test this

static bool window_in_list(struct table* list, pid_t pid) {
  static char pid_name_buffer[PROC_PIDPATHINFO_MAXSIZE];
  proc_name(pid, pid_name_buffer, sizeof(pid_name_buffer));
  if (table_find(list, pid_name_buffer)) return true;
  return false;
}
FelixKratz commented 8 months ago

This works for system settings and it contains a whitespace as well:

borders blacklist="System Settings"
CampAsAChamp commented 8 months ago

Hm, do you know how to get the name for the application then? When I put

borders blacklist="IntelliJ IDEA"

It doesn't seem to work when I do that, even though that's the name of the app in the applications folder and in the dock.

FelixKratz commented 8 months ago

Try running:

ps aux | grep -i intellij

Possibly the process is named differently, maybe try just idea