Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

CarloCattano/workspacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visual Workspace Switcher

Developed for Hyprland

Workspacer is a utility designed to enhance workspace management by providing a visual overview of each workspace's contents, facilitating seamless switching between them.

Requirements

Ensure you have the following dependencies installed:

  • grim: CLI screenshot tool
  • jq: JSON parser
  • socat: Multipurpose relay

Usage

Simply bind the workspaced.py script to a key or integrate it into your system bar for quick access to workspace previews and switching.

  • Move Window to Workspace: hold shift while clicking on a workspace, and the last active window will be moved to the selected workspace.

Features

  • One screenshot per ws/monitor
  • Customizable colors
  • Move last focused window to workspace (holding left shift while clicking on a workspace) a.k.a fake_drag_n_drop
  • New Empty workspace [ + ] to go, or move a window to a new workspace if while holding left-shift

Example Keybinding

bind = $Mod , Y, exec , $HOME/scripts/hypr/workspaced.py

Configuration

To enable previews of windows within each workspace, run the workspace_listener.sh script in the background. Configure it in your system settings or a configuration file like ~/.config/hypr/hyrland.conf.

exec-once = $HOME/scripts/hypr/workspace_listener.sh

This script utilizes Hyprland's own IPC socket to snapshot the workspaces whenever a workspace is created/changed/destroyed or an application window is closed.

Colors

You can modify the colors used by the Workspace Switcher by editing the colors.conf file in the script's directory. For example:

{
  "current_workspace": "rgba(0, 255, 0, 0.6)",
  "workspace_button": "rgba(0, 0, 0, 0)",
  "workspace_button_focus": "rgba(0, 0, 0, 0)"
}

Floating Rule

windowrule = float, title:^(Workspace Selector)$

Waybar Integration

Example configuration for Waybar, trigger the Workspace Switcher when clicking on the bar title:

"hyprland/window": {
    "format": "{}",
    "separate-outputs": true,
    "on-click":"/home/YOUR_USER/../../workspaced.py",
}

TODO

  • When ws is created silently(without focus), then our UI doesnt reflect that new ws
  • Implement navigation with vim keys (hjkl)
  • Test compatibility with animations
  • Draw an empty workspace extra to move a window to a new workspace
  • Prevent script from executing multiple instances
  • Automatically remove empty workspaces when windows are closed
  • Optimize screenshot mechanism for faster performance

About

Workspace UI for hyprland

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •