Giter VIP home page Giter VIP logo

howm's Introduction

howm (Beta)

Build Status Flattr this git repo

A lightweight, tiling X11 window manager that mimics vi by offering operators, motions and modes.

Howm is on the AUR, there are two packages for it:

Come and join us on Freenode in the channel #howm

Contents

Requirements

  • Cottage is required for configuration and interacting with howm.
  • sxhkd is required for binding cottage commands to keypress.

Installation

Howm is on the AUR, there are two packages for it:

  • howm-git is the bleeding edge package.
  • howm-x11 is the package based off of stable releases.

If you can't use the AUR, then there may be a package available for your distro.

As a last resort install xcb's libraries and then, do the following:

git clone https://github.com/HarveyHunt/howm
cd howm
make
sudo make install

After howm is installed, you'll want to copy over some configuration files.

cp examples/sxhkdrc_* ~/.config/sxhkd
cp examples/howmrc ~/.config/howmrc

Then take a look at the example xinitrc for ideas on how to start howm.

Be sure to install cottage and sxhkd.

Commandline Arguments

  • -c: The path that points to an executable howmrc file.
howm -c ~/.config/howm/howmrc

Configuration

Configuration is done through the use of cottage. Any element in this structure can be changed using cottage. The syntax is as follows:

cottage -c config_var value

For example:

cottage -c bar_height 20

To override howm's default values at startup, cottage commands can be placed in a shell script and then executed by howm. Take a look at the example howmrc for ideas.

Note: When configuring colours in howmrc, enclose the colour in quotes, such as:

cottage -c border_focus "#343434"

Changing Socket Path

By default, howm will attempt to create a socket at /tmp/howm, this can be overwritten by setting the environment variable HOWM_SOCK. For example:

export HOWM_SOCK=/tmp/howm_test

Keybinds

Keybinds are now placed in multiple sxhkd files.

A keypress is bound to a call to cottage in the following form:

cottage -f func_name <args>

All of the available functions can be found here. Take a look at the example sxhkdrcs.

Scratchpad

The scratchpad is a location to store a single client out of view. When requesting a client back from the scratchpad, it will float in the center of the screen. This is useful for keeping a terminal handy or hiding your music player- only displaying it when it is really needed.

The size of the scratchpad's client is defined by SCRATCHPAD_WIDTH and SCRATCHPAD_HEIGHT.

Motions

For a good primer on motions, vim's documentation explains them well.

Please note: The modifier key that is OTHER_MOD needs to be held down whilst entering a motion.

Operators and motions are combined so that an operation can be performed on multiple things, such as clients or workspaces. The current supported motions are as follows:

  • Workspace: Perform an operation on one or more workspaces.

  • Client: Perform an operation on one or more clients.

Counts

Counts be applied to a motion, to make an operator affect multiple things. For example, you can add a 3 before a motion, meaning that the operator will affect 3 of the motions. The modifier that is used is defined by COUNT_MOD.

For example:

q2w

Will kill 2 workspaces (assuming the correct modifier keys are pressed and default keybindings are being used).

Operators

Operators perform an action upon one or more targets (identified by motions).

Implementation details for all operators can be found here.

Below are descriptions of each operator, the motions that they can perform an action upon and the mode that they work in (Note, all examples assume that the correct modifier keys have been pressed and use the default keymappings.):

  • op_kill: An operator that kills an arbitrary number of targets. Can be used on:

    • Clients
    • Workspaces

    Used in mode:

    • Normal
q4c

The above command will kill 4 clients, closing the applications and removing them from the workspace.

qw

The above command will kill one workspace. This means that all clients on the current workspace will be killed.

  • op_move_down: An operator that moves a group of targets down one. Can be used on:

    • Clients

    Used in mode:

    • Normal
j2c

The above command moves 2 clients down one place in the workspace's client list. If a client is moved past the last place, then it is wrapped around and placed at the start of the workspace's client list.

  • op_move_up: This is the opposite of op_move_down, and instead is bound to k.

  • op_shrink_gaps: An operator to shrink the size of the gaps around windows. The size is changed by the amount defined for OP_GAP_SIZE. Can be used on:

    • Clients
    • Workspaces

    Used in mode:

    • Normal
g1w

The above command will shrink the gaps of all windows on the current workspace by OP_GAP_SIZE.

g4c

The above command will shrink the gaps of 4 clients on the current workspace by OP_GAP_SIZE.

  • op_grow_gaps: This is the opposite of op_shrink_gaps and is bound to Shift + g.

  • op_focus_up: Move the current focus up. Can be used on:

    • Clients
    • Workspaces

    Used in mode:

    • Focus
j3c

The above command will move the current focus down 3 clients.

  • op_focus_down: Performs the opposite of op_focus_up and is instead bound to j.

  • op_cut: Cut a group of clients or workspaces and store them on the delete register stack. Can be used on:

    • Clients
    • Workspaces

    Used in mode:

    • Normal
d2c

The above command will cut 2 clients and place them onto the delete register stack. One use of the cut operation takes up one place on the stack.

Modes

A good primer on modes is available here.

Note: Modes used to be implemented in howm itself, but are now in the sxhkd configuration file.

In howm, modes are used to allow the same keys to be bound to multiple functions. Modes also help to logically separate what needs to be done to a window. The available modes are as follows:

  • Normal: This mode is the one that you will spend most of your time in. It is used for executing commands and most of the operators are designed to work in this mode. This mode behaves similarly to how other WMs behave, but without focusing or dealing with floating windows.

  • Focus: This mode is designed to be used to change the focus and locations of windows or workspaces.

  • Floating: This mode is designed to deal with all things floating. Moving, resizing and teleporting floating windows are all available in this mode.

Code Documentation

howm uses doxygen throughout the entire codebase. The generated documentation is available here.

Parsing Output

When debug mode is disabled, howm outputs information about its current state and the current workspace whenever something changes (such as adding a new window). When debug mode is enabled, information is outputted for each workspace (placed on a new line).

The format for the output is as follows:

Layout:Workspace:State:NumberofClients:MonitorIndex

An example output can be seen below:

2:1:0:1:0

The information outputted at the same time as the example above, but with debugging mode turned on is shown below:

2:1:0:1:0
2:2:0:0:0
2:3:0:0:0
2:4:0:0:0
2:5:0:0:0

howm's People

Contributors

anshulk avatar bryant1410 avatar fdeitylink avatar harveyhunt avatar pirj avatar reisen avatar su8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

howm's Issues

Invisible windows, multiple context menus

Windows seem to behave weirdly - initially plain white with no content visible, appears on double click though.

Right clicking multiple times gives multiple context menus with none responding to mouse click.

Screenshot

Typo in readme

CENTER_FLOATING: Whether a window that has just been chaned to floating should be centered or not.

"chaned" should probably be "changed".

Rewrite Docs

A lot has changed on the feature/ipc_config branch which means that the current docs are out of date.

Information needs adding about cottage, how sxhkd is used and how to configure howm.

Workspaces should keep track of the number of clients

I think it is important for there to be an unsigned int within the workspace struct to keep track of the number of clients.

It would make op_cut and paste far easier, as well as reducing the amount of for loops (and therefore complexity and execution time) within the code.

  • remove_client should take one away from the count
  • create_client should add one to the count.

Single client mode?

In window managers like bspwm its possible to toggle to monocycle layout to only focus one window. Is there any support for this yet? I couldn't find it yet.

Implement Querying State

I think that it should be possible to ask howm information about its current state, such as layout, mode, config options etc.

This would also be helpful for querying information about clients, workspaces etc. Imagine being able to write a small program that can be used to search and then focus a given window.

Unit Testing

It would be great if we could get some unit testing into howm. I see two ways of doing it:

  • Use minunit, a VERY lightweight unit testing lib.
  • Compile howm into a .so and then use Python's great unit testing framework with the help of ctypes..

Opinions?

Logo

It's about time that howm had a logo. Perhaps something blocky and pixel like?

Split into multiple files

I think that the time has come for howm to be split into multiple files. This will make testing, documenting and reading the code easier- it is something that I should have done a long time ago.

I don't have much time as I am starting back at university- does anyone else want to give this a try?

Note: A few months ago I began work on this, the work is in the refactor branch- but a lot has changed since then so be warned.

Use Xresources for example

Dzen2 can read it's configuration from .Xresources. It would be good to make use of it, it makes the config cleaner and improve understanding of what dzen is.

Reimplement the dot operator

This was removed with the move to using cottage for commands.

By saving the IPC string of the last command, it should be possible to call ipc_process on the string to rerun the last command.

External Scripting

I think it would be a nice idea to add external scripting to howm. This could either be done by reading from a FIFO (as is done in the dwm-fifo patch) or by creating bindings to another language (such as python).

At the moment I am leaning towards using a FIFO (I rather like the system used by cmus).

Commented bar.sh

Maybe this will help newcomers. If I made any mistake, feel free to comment!

#!/bin/bash

# Create a named pipe for howm config output
ff="/tmp/howm.fifo"

# Create a logfile for howm log output
logfile="/home/harvey/.config/howm/log.txt"

# Create the pipe, if not existing
[[ -p $ff ]] || mkfifo -m 666 "$ff"

# Create a few workspaces and store them into an array
ws=("term" "vim" "www" "chat" "media")

# Mapping for layouts and the numbers that come from howm
lay=("" "" "" "")

# Set background color mappings
mbg=("#333333" "#5F5F87" "#AFD7AF")
# Set foreground color mappings
mfg=("#DDDDDD" "#333333" "#333333")

# Set background color for bar (dzen)
bg="#333333"

# Read howm pipe as howmout variable
while read -t 10 -r howmout || true; do
    # Check the output for a format that we can use
    if [[ $howmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        unset r
        # Read all needed howm output to seperate variables (seperated by :)
        IFS=':' read -r m l w s c <<< "$howmout"
        # Set the foreground color using the mappings
        r+='^fg('"${mfg[$m]}"')'
        # Set the background color using the mappings
        r+='^bg('"${mbg[$m]}"')'
        # Display the layout symbol for the current workspace
        r+=" ${lay[$l]} | "
        # Display the workspace name of the current workspace
        r+="${ws[$w - 1]}"
        # Brace expansion 
        r="${r%::*}"
    fi
    # Display the collected bar string and additionally the date on the right side
    printf "%s%s\n" "$r" " | $(date +"%F %R") "
# Pass those things to dzen and display it with specific height, background color, font and more
done < "$ff" | dzen2 -h 20 -y -20 -ta r -bg "$bg" -fn "Inconsolata-dz:size=10" &

# pass output to fifo
/usr/bin/howm -c ~/.config/howm/howmrc 1> "$ff" 2> "$logfile"

Scratchpad

I really like i3's use of a scratchpad- a window that can be called up as a floating window, no matter which workspace you're on.

In regards to implementing this, I think that the best way is to store the client in a global variable and append the client to the end of a workspace's client list.

Complete Doxygen Comments

This is the perfect task for a new comer - there are still quite a few comments that need updating and completing.

Move to TravisCI's containers

I wanted to do this a few months ago, but the lack of sudo in containers meant it was impossible to install packages - this has been worked around now. Select packages can be installed using a whitelist policy, I wonder if the obscure packages howm requires will be on that whitelist...

Visual Mode

It might be a nice idea to have a mode whereby windows can be selected that an operation will then be performed upon.

The selected windows could have a different border colour to the unselected ones?

Use a different socket for testing

Testing howm inside of howm is currently impossible.

A commandline option needs to be added so that a different socket can be specified.

New release?

Hi hunt,

You've merged a good number of commits from the develop branch to the master one a while back (d810ad1). Perhaps it would be time for a new release? If so, a gpg signature for distro packaging would also be nice to have. :)

Cheers

TravisCI build is failing

This might be because of changes I have made to the code, or perhaps the required packages have changed.

Can someone on ubuntu please try to compile howm, after installing the packages in the .travis.yml

Correctly handle _NET_WM_DESKTOP in client_message_event()

A window may wish to be moved to a different workspace. This should be handled in client_message_event.

In order to do this, we need to be able to move an arbitrary client to a workspace. This can be achieved by factoring out the client {cutting,pasting} logic from op_{cut,paste} into their own functions.

_NET_WM_DESKTOP also needs to be added to ewmh_net_atoms.

Optimisations

howm isn't a fast and responsive as I would like, optimisations need to be made.

A good example is when killing a workspace. remove_client refocuses all of the windows- that's rather wasteful.

Mouse support

I think it is important for howm to have better mouse support. I don't like using the mouse with a tiling WM, but sometimes it is necessary.

We should support resizing and moving windows using the mouse.

Startup Applications

I think having the ability to autostart applications and set properties about them (such as which workspace they are one, are they floating etc...) would be rather useful and simple to implement.

Cursor is a cross

The cursor looks like a cross a lot of the time. This doesn't happen with other WMs.

howm hangs when killing all clients

Howm gets into an infinite loop when kill_ws is used and wss[cw].current isn't correctly updated. If wss[cw].current becomes NULL then kill_client will return early, leading to an infinite loop.

Remove config.h

I think the time has come to move away from config.h, it is making refactoring howm into multiple files tricky, makes howm harder to package and requires that a compiler is installed.

I am thinking about using a bspwm style system, using cottage to send configuration, such as:

cottage conf workspaces 5

I am unsure what the best way to handle key bindings is - any ideas?

Multi Monitor Support

This has been requested by a lot of people and is something that should be added in the future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.