diff --git a/README.md b/README.md index fe74c61..cb51ed3 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ blur-background-exclude = [ ![image](https://user-images.githubusercontent.com/82973108/160370578-3ea7e3e9-723a-4054-b7b0-2b0110d809c0.png) ### Config -Configuration options can be found by passing in the argument `--help` on the command line, or by specifying a config file with the argument `-c`. The config file is just a simple json file with the keys being the same as the command-line arguments (except without the "--" at the beginning). +Configuration options can be found by passing in the argument `--help` on the command line, or by specifying a config file with the argument `-c`. The config file is just a simple json file with the keys being the same as the command-line arguments (except without the "--" at the beginning). To exclude windows, create a config file with "exclude-list" (look at example-config.json) and put the window class names to this list, you can find out the name of a class using `xprop | grep WM_CLASS` # Updating cd into the xborders directory and run `git pull origin main` diff --git a/example_config.json b/example_config.json index 3c09556..e136725 100644 --- a/example_config.json +++ b/example_config.json @@ -1,9 +1,10 @@ { - "border-rgba": "0xFFFFFFFF", + "border-rgba": "#FFFFFFFF", "border-radius": 14, "border-width": 4, "border-mode": "outside", "disable-version-warning": false, + "exclude-list": ["Ulauncher", "firefox"], "positive-x-offset": 0, "positive-y-offset": 0, diff --git a/xborders b/xborders index 02bd26a..93f5f3f 100755 --- a/xborders +++ b/xborders @@ -22,6 +22,7 @@ VERSION = 3.4 INSIDE = 'inside' OUTSIDE = 'outside' CENTER = 'center' +EXCLUDE = [] BORDER_MODES = [INSIDE, OUTSIDE, CENTER] BORDER_MODE = INSIDE BORDER_RADIUS = 14 @@ -168,6 +169,8 @@ def get_args(): args.__dict__[ident] = dat[ ident ] # Idea gotten from here: https://stackoverflow.com/a/1325798 + else: + args.exclude_list = [] global BORDER_RADIUS global BORDER_WIDTH @@ -176,6 +179,7 @@ def get_args(): global BORDER_G global BORDER_B global BORDER_A + global EXCLUDE global SMART_HIDE_BORDER global NO_VERSION_NOTIFY global OFFSETS @@ -188,6 +192,7 @@ def get_args(): BORDER_A = args.border_alpha NO_VERSION_NOTIFY = args.disable_version_warning SMART_HIDE_BORDER = args.smart_hide_border + EXCLUDE = args.exclude_list OFFSETS = [ args.positive_x_offset or 0, args.positive_y_offset or 0, @@ -429,6 +434,12 @@ class Highlight(Gtk.Window): self.border_path = [x, y, w, h] def _draw(self, _wid, ctx): + active_window = _wid.wnck_screen.get_active_window() + if active_window: + class_group_name = active_window.get_class_group_name() + if class_group_name in EXCLUDE: + return + ctx.save() if self.border_path != [0, 0, 0, 0]: x, y, w, h = self.border_path