Skip to content

Commit

Permalink
feat(clipboard): mark wlclipboard incompatible with awesomewm
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed Jan 4, 2024
1 parent aec93d3 commit 5c806ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions normcap/clipboard/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def _os_has_wayland_display_manager() -> bool:
has_wayland_display_env = bool(os.environ.get("WAYLAND_DISPLAY", ""))
return "wayland" in xdg_session_type or has_wayland_display_env

@staticmethod
def _os_has_awesome_wm() -> bool:
if sys.platform != "linux":
return False

return "awesome" in os.environ.get("XDG_CURRENT_DESKTOP", "").lower()

@abc.abstractmethod
def _is_compatible(self) -> bool:
... # pragma: no cover
Expand Down
4 changes: 4 additions & 0 deletions normcap/clipboard/handlers/wlclipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def _is_compatible(self) -> bool:
)
return False

if self._os_has_awesome_wm():
logger.debug("%s is not compatible with Awesome WM", self.name)
return False

if not (wl_copy_bin := shutil.which("wl-copy")):
logger.debug("%s is not compatible: wl-copy was not found", self.name)
logger.warning(
Expand Down

0 comments on commit 5c806ed

Please sign in to comment.