Active window border replacement for window managers.

Overview

xborder

Active window border replacement for window managers.

Usage

git clone https://github.com/deter0/xborder
cd xborder
chmod +x xborders
./xborders --help

Dependencies

Make sure you have these!

  • pycairo (Tested with version 1.21.0, pip install pycairo)
  • xdotool (Tested with version 3.20211022.1 sudo pacman -S xdotool)
  • gtk
  • a compositor (picom is what I am using or you can use another compositor)

Note for compositor

If you don't want your entire screen blurred please add class_g = 'xborder' to your blur-exclude!

blur-background-exclude = [
  # prevents picom from blurring the background
  "class_g   = 'xborder'",
  ...
];

xborder:

image

i3:

image

Fun desktop stress toy

fun

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).

Comments
  • too much cpu consumption

    too much cpu consumption

    after using xborders my cpu usage goes up to 30% even when no apps are running. is this normal ?\

    EDIT: also when i go fullscreen in i3 i can still see the curved borders . How do i fix that?

    opened by arnavgr 12
  • Moved from window geometry to client geometry;

    Moved from window geometry to client geometry;

    Hi everybody, Using xborder I noticed that there is an annoying gap on all the "Jetbrains" products.

    image

    So I decided to investigate and I discovered the error: The problem is in the following line: https://github.com/deter0/xborder/blob/0a8e5c951806b0f30ddec59ce26677f7075cf9b2/xborders#L386

    It seems that using window.get_geometry() can cause problems for some windows, so I replaced with window.get_client_window_geometry() and everything works fine for me.

    image

    In addition, I do some little refactoring in order to improve the code quality and readability.

    Hope this can help.

    opened by ZappaBoy 7
  • Add support for title bar (i3)

    Add support for title bar (i3)

    I am currently using i3 and the border ignores the title bar. It would be cool if it also included the title bar.

    for_window [class=".*"] title_format " %title" could be used to add a padding to the title bar text in i3 to not be obstructed by the rounded corners.

    I don't know how easy this is to fix but a workaround would be allowing to set the radius of the corners individually. This allows settings the top left and top right corner to radius=0 which would at least result in rounded corners at the bottom.

    Great work!

    2022-08-23_17-41

    enhancement 
    opened by jfaltis 6
  • top border for Webstorm not aligned with window

    top border for Webstorm not aligned with window

    This is happening only with Webstorm (and I guess other IntelliJ-based programs; Might be related to Java programs in general?):

    When opening webstorm, the top border created by xborder seems to be rendered at an offset of a good 15-20px higher than the window (See image):

    image

    I tried using --border-mode inside | outside | center but I still get the same result

    WM: i3-gaps-rounded-git, version 4.20.1-98-ga70b89a7

    opened by dmolin 5
  • Re-focusing on a fullscreen window enables xborders

    Re-focusing on a fullscreen window enables xborders

    I just saw your commit that fixed the mpv issue, so I installed the new version! You added a cool feature (I didn't really check the commits to see if it was intentional tho) that disables xborders when you fullscreen a window (on i3). I really liked it. But when you switch to another window and switch back to the maximized window, xborders reappears. Its a bit annoying in multiple monitor setups, but I can't see xborders using one display or when I have a maximized window on both screens.

    Edit: I tested some gtk applications (gVIM, zathura, virt-manager) and I could see the xborders in the corner of them when their window was maximized.

    opened by nimaaskarian 4
  • Add better support for i3

    Add better support for i3

    There are some issues with the render position of the outline in i3, especially when using window borders and in tabbed layout.

    These can be fixed while also improving performance by making use of the i3 IPC to listen to window events and retrieve the focused window dimensions.

    I've implemented this in my fork along with some other QoL features (custom color, easy install through pip/pipx with feature switches, hide border in fullscreen). All very hacked together, so I'd be happy to re-implement those as separate PRs here if that's wanted.

    opened by coloursofnoise 4
  • Improve performance by ~20-25% and fix syntax error in draw.py

    Improve performance by ~20-25% and fix syntax error in draw.py

    This commit aim is to solve performance issues #17 and fix #18 The reason why the performance improvement is working is that calling subprocess.run or Popen in every drawing cycle is very expensive, because subprocess will call out to the shell which will execute xdotool or xprop after which we need to parse the output. Instead of these slow calls we should use Wnck.Window methods to get the same properties. This part of the refactoring caused a 5-10% performance improvement,

    In the other hand I've removed the self.input_shape_combine_region(cairo.Region()) from _on_draw which caused another 15-20% improvement on CPU usage. I'm not sure why that line was there, so I've left it commented out with a TODO note for future removal.

    opened by SilverTux 3
  • Can the border be applied to all windows?

    Can the border be applied to all windows?

    Title, I wasn't able to find any options or docs on having the window applied to all window on the desktop. For some context I am using only I3 as a window manager without a desktop environment which maybe is causing this to happen if it not intended. Thanks!,

    opened by danielbjanes 2
  • Add feature of drawing borders on unfocused windows too

    Add feature of drawing borders on unfocused windows too

    This PR aim is to resolve #16

    • Add function to query a window map state using xwininfo command given an X window id
    • There is a caching mechanism for querying window map state and storing it in viewable_window_map. Every half a second it will be updated for every window and to prevent this map to grow uncontrolled (when closing windows we don't want those items in our map) we need to cleanup somehow, the current logic is to throw the whole map and recreate it on demand.
    opened by SilverTux 2
  • README better examples

    README better examples

    "You could amend your readme to explain that one needs to set up rounded corners in picom.conf, set borders to 0 in the i3 config, that the picom corner radius should match `border-radius and give a short example json-file like

    {
      "border-radius": 10, 
      "border-width": 5, 
      "border-rgba": "FFFF00FF" 
    }
    

    might seem obvious, but still...."

    u/r_wraith on reddit

    documentation good first issue 
    opened by deter0 2
  • Cleaned up some files and created a config.json for ease of use.

    Cleaned up some files and created a config.json for ease of use.

    I've cleaned up some code and added a config.json file for customization. I also updated the README. No actual functionality has changed and it works as normal.

    opened by zDevy 2
  • Add gradient border

    Add gradient border

    This adds some new options to the script, allowing you to have gradient borders.

    The --border-gradient option accepts a list of RGBA colors, which will make up the gradient.

    The --rainbow option will create a rainbow gradient (using the built in colorsys module's hsv_to_rgb) The --rainbow-steps option specifies how many colors the rainbow gradient should use, the default being 20. This can slightly affect performance, but around 20 seems to be the sweet spot where performance is good but both ends of the gradient are roughly the same color. The --rainbow-saturation option specifies the saturation of the colors in the rainbow gradient, this is nice to get a sort of pastel look. The --rainbow-brightness option specifies the brightness of the colors in the rainbow gradient, for customization and completeness.

    The --absolute-gradient option makes the gradient 'absolute,' so it doesn't move with the current window. This gives the effect that the border is masking the gradient.

    opened by fun840 0
  • Launch failure: KeyError: 'could not find foreign type Region'

    Launch failure: KeyError: 'could not find foreign type Region'

    xborders: 3.2 (pulled today, 2022-10-05) OS: Debian Sid (unstable) 5.19.11-1 Host: 80S6 Lenovo N22 (amd64) Python: 3.10.7 WM: i3-gaps 4.21-18-gcee84a56

    xborders isn't able to start:

    ❯ ./xborders
    /home/a/git/xborder/./xborders:280: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
      self.set_wmclass("xborders", "xborder")
    Traceback (most recent call last):
      File "/home/a/git/xborder/./xborders", line 449, in <module>
        main()
      File "/home/a/git/xborder/./xborders", line 443, in main
        Highlight(screen_width, screen_height)
      File "/home/a/git/xborder/./xborders", line 298, in __init__
        self.input_shape_combine_region(cairo.Region())
    KeyError: 'could not find foreign type Region'
    
    bug testing needed 
    opened by serif 5
  • Allow blacklisting applications

    Allow blacklisting applications

    I don't know if it is currently possible to do so, since there is no issue that states this problem, but some of my applications like xfdesktop, ulauncher and the GTK based applications look weird when used with xborders, on the GTK applications there is a big gap between xborders and the GTK application window, I guess probably because of GTK frames. I do want xborder to work with GTK applications, so if it is possible to fix it instead of adding GTK apps to blacklist, it would be amazing, something similar happens with ULauncher and xfdesktop is just a component of the xfce session so idk why it has borders.

    enhancement 
    opened by Syndrizzle 0
  • xborder or xborders?

    xborder or xborders?

    The repository is named xborder, the window's role is xborder

    The title of the README is xborders, the executable is xborders and xborders is used all over the README

    opened by victorbnl 2
Owner
deter
one day i will write code that writes code. they/them
deter
An unopinionated replacement for PyTorch's Dataset and ImageFolder, that handles Tar archives

Simple Tar Dataset An unopinionated replacement for PyTorch's Dataset and ImageFolder classes, for datasets stored as uncompressed Tar archives. Just

Joao Henriques 47 Dec 20, 2022
Implementation of gMLP, an all-MLP replacement for Transformers, in Pytorch

Implementation of gMLP, an all-MLP replacement for Transformers, in Pytorch

Phil Wang 383 Jan 2, 2023
Improving Machine Translation Systems via Isotopic Replacement

CAT (Improving Machine Translation Systems via Isotopic Replacement) Machine translation plays an essential role in people’s daily international commu

Zeyu Sun 10 Nov 30, 2022
Reproducing code of hair style replacement method from Barbershorp.

Barbershorp Reproducing code of hair style replacement method from Barbershorp. Also reproduces II2S, an improved version of Image2StyleGAN. Requireme

null 1 Dec 24, 2021
Supplementary code for TISMIR paper "Sliding-Window Pitch-Class Histograms as a Means of Modeling Musical Form"

Sliding-Window Pitch-Class Histograms as a Means of Modeling Musical Form This is supplementary code for the TISMIR paper Sliding-Window Pitch-Class H

null 1 Nov 27, 2021
Alfred-Restore-Iterm-Arrangement - An Alfred workflow to restore iTerm2 window Arrangements

Alfred-Restore-Iterm-Arrangement This alfred workflow will list avaliable iTerm2

null 7 May 10, 2022
Supervised Sliding Window Smoothing Loss Function Based on MS-TCN for Video Segmentation

SSWS-loss_function_based_on_MS-TCN Supervised Sliding Window Smoothing Loss Function Based on MS-TCN for Video Segmentation Supervised Sliding Window

null 3 Aug 3, 2022
GEP (GDB Enhanced Prompt) - a GDB plug-in for GDB command prompt with fzf history search, fish-like autosuggestions, auto-completion with floating window, partial string matching in history, and more!

GEP (GDB Enhanced Prompt) GEP (GDB Enhanced Prompt) is a GDB plug-in which make your GDB command prompt more convenient and flexibility. Why I need th

Alan Li 23 Dec 21, 2022
A modular active learning framework for Python

Modular Active Learning framework for Python3 Page contents Introduction Active learning from bird's-eye view modAL in action From zero to one in a fe

modAL 1.9k Dec 31, 2022
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.

This is the Vowpal Wabbit fast online learning code. Why Vowpal Wabbit? Vowpal Wabbit is a machine learning system which pushes the frontier of machin

Vowpal Wabbit 8.1k Jan 6, 2023
Code for Multiple Instance Active Learning for Object Detection, CVPR 2021

Language: 简体中文 | English Introduction This is the code for Multiple Instance Active Learning for Object Detection, CVPR 2021. Installation A Linux pla

Tianning Yuan 269 Dec 21, 2022
Code for Multiple Instance Active Learning for Object Detection, CVPR 2021

MI-AOD Language: 简体中文 | English Introduction This is the code for Multiple Instance Active Learning for Object Detection (The PDF is not available tem

Tianning Yuan 269 Dec 21, 2022
Code for the Active Speakers in Context Paper (CVPR2020)

Active Speakers in Context This repo contains the official code and models for the "Active Speakers in Context" CVPR 2020 paper. Before Training The c

null 43 Oct 14, 2022
Tutorial on active learning with the Nvidia Transfer Learning Toolkit (TLT).

Active Learning with the Nvidia TLT Tutorial on active learning with the Nvidia Transfer Learning Toolkit (TLT). In this tutorial, we will show you ho

Lightly 25 Dec 3, 2022
Official PyTorch code for CVPR 2020 paper "Deep Active Learning for Biased Datasets via Fisher Kernel Self-Supervision"

Deep Active Learning for Biased Datasets via Fisher Kernel Self-Supervision https://arxiv.org/abs/2003.00393 Abstract Active learning (AL) aims to min

Denis 29 Nov 21, 2022
gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks.

gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks. It is built on top of the OpenAI Gym toolkit.

Robin Henry 99 Dec 12, 2022
Active and Sample-Efficient Model Evaluation

Active Testing: Sample-Efficient Model Evaluation Hi, good to see you here! ?? This is code for "Active Testing: Sample-Efficient Model Evaluation". P

Jannik Kossen 19 Oct 30, 2022
Look Who’s Talking: Active Speaker Detection in the Wild

Look Who's Talking: Active Speaker Detection in the Wild Dependencies pip install -r requirements.txt In addition to the Python dependencies, ffmpeg

Clova AI Research 60 Dec 8, 2022
Submodular Subset Selection for Active Domain Adaptation (ICCV 2021)

S3VAADA: Submodular Subset Selection for Virtual Adversarial Active Domain Adaptation ICCV 2021 Harsh Rangwani, Arihant Jain*, Sumukh K Aithal*, R. Ve

Video Analytics Lab -- IISc 13 Dec 28, 2022