Skip to content

lpp-crypto/etabli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETABLI: name-based workspace management for SWAY

#+Time-stamp: <2025-10-11 12:29:24>

Initial Disclaimer

This project is taking shape: I use as my daily driver on two different computers without any problems. Let’s say it is in the beta phase.

What is Etabli?

Overview

**Etabli** is a toolset to simplify, naming, grouping, and navigating through workspaces in sway (it should work fine with i3 as well).

The core idea is to give a function to workspace, and to group these workspaces into “levels” that, themselves, correspond to different tasks/projects, etc. You can see it as each level being a large virtual workspace that spans multiple real workspaces. To help with this, a waybar plugin is also provided.

Let’s see what it means in practice. In the screencap below, look at the top left, on the waybar. The levels are “1” and “etabli”. Then, level “1” contains 3 workspaces (“comms”, “firefox”, and “steam”), and “etabli” contains another 3. The idea here is that “1” corresponds essentially to personal stuff (it is the default name), while “etabli” contains the workspaces I use to work on it.

./figures/example.png

Based on my sway configuration, I can do the following. By hitting mod-o or mod-u, I can cycle through the workspaces within a given level; and by hitting mod-1 or mod-2 I can cycle through the levels. Hitting mod-p creates a new workspace within a level. Doing any of these operations while holding shift will do the same, except that the focused windows will come along. For example, mod-Shift-p will create a new workspace containing the current window.

Additional functionalities are provided using basic rofi scripts, such as an easy renaming of a workspace, or a way to jump to another workspace (see below).

./figures/workspace-switcher.png

The “prepare” utility allows the creation of a new workspace within a level for which the creation will call some programs. For example, prepare etabli/firefox would create a new workspace called firefox and start the browser in it. This behaviour is easily configured in the .etabli_config.toml file that you must put in your home.

CLI tools

**Etabli** provides the following four CLI tools.

etabli
use this one to cycle through workspaces, through levels, etc. Add calls to this one in your sway configuration (examples are given further below).
etabli_waybar
this one provides daemon that outputs a new pango formatted string anytime a change to the workspace is made. It can thus be piped into
etabli_prepare
TODO

Setup

Dependencies

Etabli needs the i3ipc-python module (pip install i3ipc-python), and rofi (though it should work with your favorite choice of dmenu-type interface).

Sway configuration

To use, simply add something like the following snippets to your sway configuration, where ~/etabli/etabli.py needs to be replaced by the actual path.

Moving within levels

bindsym $mod+o exec etabli --next_workspace_in_level
bindsym $mod+u exec etabli --previous_workspace_in_level
bindsym $mod+p exec etabli --new_workspace_in_level

With this configuration, pressing mod+o will move the focus to the next workspace (in alphabetic order) on the same level. It does nothing if there is a single workspace on this level. Pressing mod+u moves the other way. Finally, pressing mod+p moves the focus to a new workspace on the same level, whose name is an increasing counter.

Moving in general

The levels (including those with a unique workspace) are displayed in alphabetic order, not by increasing indices (on purpose). To switch workspace in the same order (as if they were, say, firefox tabs), you can also add the following.

bindsym $mod+Next exec etabli --next_workspace
bindsym $mod+Prior exec etabli --prev_workspace

The keys Next and Prior correspond to the “page down” and “page up” keys. Pressing mod+page down will then shift to the next workshop in the list as it is displayed, ignoring the division into levels.

Rofi

See the ./rofi folder and its readme.org file.

Waybar

Adding the following to your waybar configuration will enable you to add a module to it that replaces the sway/workspaces one. The advantages of this replacement one is that the workspaces are shown in alphabetic order rather than in order of creation, and that the levels appear explicitely. The main downside is that clicking on a specific workspace doesn’t do anything specific to that workspace. Instead, with the following configuration, a left click and a right click select the previous/next workspace, and a middle-click opens the rofi-based workspace switcher.

"custom/etabli": {
    "format": " {}",
    "exec": "python3 $HOME/etabli/waybar_daemon.py",
    "restart-interval": 1,
    "return-type": "json",
    "on-click": "python3 $HOME/etabli/etabli.py prev_workspace",
    "on-click-right": "python3 $HOME/etabli/etabli.py next_workspace",
    "on-click-middle": "zsh $HOME/etabli/rofi/rofi-workspace-switch",
},

The appearance of the waybar module is configured by changing the prettifying functions at the top of the waybar_daemon.py script. The default setting is intended to be used with the following waybar CSS.

#custom-etabli {
    background-color: rgba(170, 170, 170, 0.9);
    padding-left:2px;
    padding-right:2px;
}

About

Name-based workspace management in swaywm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages