/$$$$$$ /$$
/$$__ $$| $$
| $$ \__/| $$ /$$$$$$ /$$ /$$ /$$ /$$ /$$ /$$
| $$$$ | $$ /$$__ $$| $$ | $$ | $$| $$ | $$ | $$
| $$_/ | $$| $$ \ $$| $$ | $$ | $$| $$ | $$ | $$
| $$ | $$| $$ | $$| $$ | $$ | $$| $$ | $$ | $$
| $$ | $$| $$$$$$/| $$$$$/$$$$/| $$$$$/$$$$/
|__/ |__/ \______/ \_____/\___/ \_____/\___/
floww is a command-line utility designed to streamline your workflow setup on Linux desktops. Define your desired workspace layouts and application sets in simple configuration files currently supporting yaml, json and toml, and let floww automate the process of switching workspaces and launching applications.
- Workflows: Define your workflows in a configuration file of your choice. (currently supporting yaml, json and toml)
- Workspace Management: Automatically switch to specified virtual desktops/workspaces.
- Application Launching: Launch binaries, Flatpaks, and Snaps with arguments.
- Flexible Timing: Configure wait times between actions for smoother transitions.
- Interactive Mode: Select workflows easily if you don't specify one.
- Validation: Check your workflow files for correctness before applying them.
- Simple CLI: Manage workflows with intuitive commands (
init,list,apply,add,edit,remove,validate).
Before installing floww, ensure you have the following dependencies:
- Workspace Switching Backend:
flowwneeds a tool to interact with your window manager/desktop environment. It prioritizesewmhlib(Python library, which is already packaged infloww) and falls back towmctrl(command-line tool). If the defaultewmhlibfails,flowwwill fall back towmctrl.wmctrl: A common command-line tool, often needed as a fallback or ifewmhlibencounters issues (especially on Wayland setups where EWMH support might be incomplete).- Installation (wmctrl):
- Debian/Ubuntu:
sudo apt update && sudo apt install wmctrl - Fedora:
sudo dnf install wmctrl - Arch Linux:
sudo pacman -S wmctrl
- Debian/Ubuntu:
- Notification Daemon (Optional but Recommended):
flowwusesnotify-sendto display completion or error messages.- Installation (notify-send):
- Debian/Ubuntu:
sudo apt update && sudo apt install libnotify-bin - Fedora:
sudo dnf install libnotify - Arch Linux:
sudo pacman -S libnotify
- Debian/Ubuntu:
- Installation (notify-send):
- Text Editor (for
editcommand): Thefloww editcommand uses the editor specified in your$EDITORenvironment variable. If not set, it tries common editors likevim,vi, ornano. Set$EDITORfor the best experience:export EDITOR=vim(add this to your shell configuration, e.g.,.bashrcor.zshrc).
- Using script
curl -fsSL https://raw.githubusercontent.com/dagimg-dot/floww/refs/heads/main/scripts/install.sh | sh- Using eget
eget dagimg-dot/flowwIt's recommended to install floww in a virtual environment. uv is recommended for this.
-
Clone the repository (if you haven't already):
git clone https://github.com/dagimg-dot/floww.git cd floww -
Create and activate a virtual environment (using
uv):uv venv source .venv/bin/activate -
Install
floww:make install
-
Verify installation:
floww --version
floww provides several commands to manage and apply your workflows.
Note:
- All options have short and long forms. like
-eand--edit.- The commands
apply,remove,editandvalidatehave autocompletion for workflow names. Checkoutfloww --show-completionandfloww --install-completionfor more information.
-
Initialize Configuration: Run this first to create the necessary configuration directory (
~/.config/floww) and workflows subdirectory.floww init
- Use
floww init --exampleto also create a sampleexample.yamlworkflow file. - Use
floww init --example --type <type>to create a sample workflow file of the specified type.
- Use
-
List Available Workflows: See the names of all workflows defined in
~/.config/floww/workflows/.floww list
-
Add a New Workflow: Create a new, basic workflow file.
floww add <workflow-name>
- Example:
floww add codingcreates~/.config/floww/workflows/coding.yaml. - Use
floww add <workflow-name> --editor-eto open the new file in your default editor immediately after creation. - Use
floww add <workflow-name> --type <type>or-t <type>to create a new workflow file of the specified type. (currently supporting yaml, json and toml)
- Example:
-
Edit an Existing Workflow: Open a workflow file in your default editor.
floww edit <workflow-name>
- If
<workflow-name>is omitted, you'll get an interactive list to choose from. - Example:
floww edit coding
- If
-
Validate a Workflow: Check if a workflow file has the correct structure and syntax without applying it. Useful for debugging.
floww validate <workflow-name>
- If
<workflow-name>is omitted, you'll get an interactive list to choose from. - Example:
floww validate coding
- If
-
Apply a Workflow: Execute the steps defined in a workflow: switch workspaces and launch applications.
floww apply <workflow-name>
- If
<workflow-name>is omitted,flowwwill present an interactive list of available workflows to choose from. - Example:
floww apply coding - Use
floww apply --file <file-path>to apply a workflow from a file path. - Use
floww apply --appendto start the workflow from the last workspace.
- If
-
Remove a Workflow: Delete a workflow file.
floww remove <workflow-name-1> <workflow-name-2> ...
- If
<workflow-name>is omitted, you'll get an interactive list to choose from. - By default, it asks for confirmation. Use
--forceor-fto skip confirmation. - Example:
floww remove old-project --force
- If
-
Get Help:
floww --help floww <command> --help # e.g., floww apply --help
-
Control Logging: Use the
--log-levelor-loption with any command to set verbosity (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default is WARNING.floww --log-level DEBUG apply my-workflow
floww uses a configuration directory typically located at ~/.config/floww (following the XDG Base Directory Specification).
- Location:
~/.config/floww/config.yaml - Purpose: Holds global settings for
floww. Currently, primarily used for timing delays during workflow application. - Format: YAML
- Default Structure (if file is empty or missing):
general: show_notifications: true # Whether to show notifications timing: workspace_switch_wait: 3.0 # Seconds to wait AFTER launching all apps in a workspace before switching to the next, unless overridden by a specific app's 'wait'. app_launch_wait: 1.0 # Default seconds to wait AFTER launching an app, IF it's NOT the last app in its workspace list AND doesn't have its own 'wait' value. respect_app_wait: true # If true, use app-specific 'wait' values when present. If false, ignore app 'wait' values and always use 'app_launch_wait' (or 0 for the last app).
- You can create this file and customize these values. Invalid values (e.g., negative numbers for waits, non-booleans for
respect_app_wait) will causeflowwto revert to the default for that specific setting.
- Location:
~/.config/floww/workflows/ - Purpose: Contains individual workflow definitions.
- Format: Each workflow is a separate file named
<workflow-name>.(yaml|json|toml).
Each workflow configuration file defines the sequence of actions:
description: "Standard Web Development Setup"
workspaces:
- target: 0 # Workspace 1 (index 0)
apps:
- name: "VS Code (Project)"
exec: "code"
type: "binary"
args: ["~/dev/my-web-project"]
wait: 2.0 # Give VS Code time to load
- name: "Project Terminal"
exec: "gnome-terminal"
args: ["--working-directory=~/dev/my-web-project"]
- target: 1 # Workspace 2 (index 1)
apps:
- name: "Firefox (Local Dev)"
exec: "org.mozilla.firefox" # Assuming Firefox installed via Flatpak
type: "flatpak"
args: ["http://localhost:3000"]
wait: 1.5
- name: "Firefox (Docs)"
exec: "org.mozilla.firefox"
type: "flatpak"
args: ["--new-window", "https://developer.mozilla.org/"]
- target: 3 # Workspace 4 (index 3)
apps:
- name: "Communication (Slack)"
exec: "slack" # Assuming Slack installed via Snap
type: "snap"
# After setting up workspaces 0, 1, and 3, switch back to workspace 0.
final_workspace: 0Note: The workflow file can be
yaml,jsonortoml. However, it must be valid for the type it is.
Key Fields Explained:
-
description(Optional, String): Human-readable description. -
workspaces(Required, List): A list of workspace objects to process sequentially.target(Required, Integer >= 0): The zero-indexed workspace number to switch to.apps(Required, List): A list of application objects to launch on this workspace.name(Required, String): A name for the application (used in output messages).exec(Required, String): The command, executable path, Flatpak App ID, or Snap name. Tilde (~) is expanded to the user's home directory.type(Optional, String): Specifies how to launch the app. Defaults tobinary.binary: Executes theexecvalue directly (e.g.,/usr/bin/firefox,code,~/scripts/my_tool).flatpak: Runsflatpak run <exec> [args...].execshould be the Flatpak Application ID (e.g.,org.mozilla.firefox).snap: Runs<exec> [args...].execshould be the snap command name (e.g.,spotify).
args(Optional, List): A list of command-line arguments to pass to the application. Arguments are converted to strings. Tilde (~) is expanded within string arguments.wait(Optional, Float >= 0): Seconds to wait after launching this specific application. Ifrespect_app_waitistrueinconfig.yaml, this value is used instead of the globalapp_launch_wait. If this is the last app in the last workspace, this wait occurs before switching to thefinal_workspace(if defined). If this is the last app in an intermediate workspace, this wait occurs before switching to the next workspace (overridingworkspace_switch_wait).
-
final_workspace(Optional, Integer >= 0): After processing all workspace definitions in theworkspaceslist, switch to this workspace number.
To apply this example:
- Save the content above as
~/.config/floww/workflows/web-dev.yaml. - Run:
floww apply web-dev
Contributions are welcome! Please follow these steps:
- Fork the repository on GitHub.
- Clone your fork locally:
git clone <your-fork-url> - Create a new branch for your feature or fix:
git checkout -b feature/my-new-featureorgit checkout -b fix/bug-description. - Make your code changes.
- Add tests for your changes in the
tests/directory. - Run tests: Ensure all tests pass using
make test(this usespytest). - Lint your code: Ensure code style consistency using
make lint(this usesruff). - Commit your changes with a clear message:
git commit -m "Add feature: description" - Push your branch to your fork:
git push origin feature/my-new-feature - Create a Pull Request on the original repository's
mainbranch.
Please also consider opening an issue first to discuss significant changes.
This project is licensed under the MIT License. See the LICENSE file for details.
-
Error: floww is not initialized. Please run 'floww init' first.
- Cause: The configuration directory (
~/.config/floww) hasn't been created. - Solution: Run
floww init.
- Cause: The configuration directory (
-
Error: Workflow
namenot found...- Cause: The specified workflow file (
<name>.yaml) doesn't exist in~/.config/floww/workflows/. - Solution: Check the spelling of the workflow name. Use
floww listto see available workflows. Ensure the file is in the correct directory.
- Cause: The specified workflow file (
-
Error: Validation failed:
- Cause: The workflow file has incorrect syntax or structure (e.g., missing required keys like
targetorapps, incorrect data types). - Solution: Run
floww validate <name>to get specific details about the schema violation. Compare your workflow file structure against the Configuration section and the Example Workflow. If it's a YAML file, check YAML indentation carefully.
- Cause: The workflow file has incorrect syntax or structure (e.g., missing required keys like
-
Error launching : Command not found...
- Cause: The executable specified in the
execfield cannot be found. - Solution:
- For
type: binary: Ensure the command is spelled correctly and is available in your system's$PATH, or provide the full path to the executable (e.g.,/usr/local/bin/mytool,~/scripts/run_dev.sh). Ensure the file has execute permissions (chmod +x <file>). - For
type: flatpak: Ensure the Flatpak Application ID is correct and the application is installed (flatpak list). - For
type: snap: Ensure the snap command name is correct and the snap is installed (snap list).
- For
- Cause: The executable specified in the
-
Error launching : Permission denied...
- Cause: You don't have permission to execute the file specified in
exec(usually fortype: binary). - Solution: Check the file permissions. You might need to add execute permissions:
chmod +x /path/to/executable.
- Cause: You don't have permission to execute the file specified in
-
Workspace switching doesn't work or switches incorrectly:
- Cause: Issues with
ewmhliborwmctrl, or incompatibility with your specific desktop environment/window manager (especially on Wayland). - Solution:
- Ensure
wmctrlis installed (see Prerequisites).flowwshould fall back to it ifewmhlibfails. - Check if your desktop environment fully supports EWMH (Extended Window Manager Hints), especially if using Wayland. Some Wayland compositors have limited or no support for external workspace control via these methods.
- Run
floww apply <name> --log-level DEBUGand check the logs for specific errors related toEwmhRootorwmctrl. - Consult your desktop environment's documentation regarding external workspace control.
- Ensure
- Cause: Issues with
-
Notifications ("Workflow applied successfully", "Workflow completed with errors") don't appear:
- Cause:
notify-sendcommand is not available or the notification daemon isn't running. - Solution: Install
libnotify-binor equivalent package for your distribution (see Prerequisites). Ensure your desktop environment's notification service is running.
- Cause:
-
Final workspace is not being applied:
- Cause: The last app in the last workspace might be taking too long to launch.
- Solution: Add a
waitvalue to the last app in the last workspace. - Note: If the last app in the last workspace has a
waitvalue, the final workspace will be applied after the wait time. - Cause: You are using
tomlas the workflow file type and final_workspace is at the end of the file. - Solution: Bring the
final_workspacedefinition up above the worskpaces section
