From 2278e83fedf65e1a066a1fe06e412f18a311ddf0 Mon Sep 17 00:00:00 2001 From: Eden <62473844+EdenQwQ@users.noreply.github.com> Date: Wed, 1 Dec 2021 09:23:07 +0800 Subject: [PATCH] Add examples; make README.md more readable Added examples: rc and sxhkdrc; Updated README.md to make it more readable when editiing; Fixed an issue in wormc.md('struts' missing in example command) --- README.md | 36 ++++++++++++++++++++++-- docs/wormc.md | 4 +-- examples/rc | 21 ++++++++++++++ examples/sxhkdrc | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 examples/rc create mode 100644 examples/sxhkdrc diff --git a/README.md b/README.md index 23de5ee..bf3af45 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,52 @@ # worm + Worm is a tiny, dynamic, tag-based window manager written in the Nim language. It supports both a floating mode and master-stack tiling with gaps and struts. Check out the screenshots on the wiki for some examples of how it looks. ## build / install -Install Nim >= 1.4.0, for example through Choosenim. Clone this directory and run + +Install Nim >= 1.4.0, for example through Choosenim. Clone this repo and run + ``` $ nimble build -d:release --gc:arc ``` And you should end up with two binaries; strip and use! -Alternatively, for users of the Arch Linux distribution, you can use the AUR package worm-git. +Alternatively, for users using Arch, you can use the AUR package worm-git. + +``` +$ yay -Sy worm-git +``` + +## configuration + +### autostart + +Worm will try to execute the file `~/.config/worm/rc` on startup. +Simply create it as a shell-script to execute your favorite applications with +worm. +(don't forget to make it executable). + +An example can be found [here](/examples/rc). + +### keybindings + +Worm does not have a built-in keyboard mapper, so you should use something like +[sxhkd](https://github.com/baskerville/sxhkd). +Please read [the doc](docs/wormc.md) to understand how wormc works before +writing your own sxhkdrc. + +An example sxhkdrc can be found [here](/examples/sxhkdrc). ## license + Licensed under the MIT license. See the LICENSE file for more info. ## credits + Thanks to [phisch](https://github.com/phisch) for making the logo! -Thanks to everyone else that's opened an issue, a PR, or just tried out worm. \ No newline at end of file + +Thanks to everyone else that's opened an issue, a PR, or just tried out worm. diff --git a/docs/wormc.md b/docs/wormc.md index ced4df9..20730b2 100644 --- a/docs/wormc.md +++ b/docs/wormc.md @@ -49,7 +49,7 @@ Clears all other tags and enables given tag. Example: `wormc switch-tag 5` ### `layout(string)` Changes layout. `floating` for floating, `tiling` for tiling, otherwise wormc exits. Eg `wormc layout tiling` ### `struts(uint top, uint bottom, uint left, uint right)` -Sets the struts, also known as the 'outer margins. These are used when maximizing windows (currently unimplemented, sorry!) and while tiling. Example: `wormc 10 50 10 10`. +Sets the struts, also known as the 'outer margins. These are used when maximizing windows (currently unimplemented, sorry!) and while tiling. Example: `wormc struts 10 50 10 10`. ### `move-tag(uint tag, window id)` Clears the tags of the provided window and turns on the given tag; for example `wormc move-tag 5 123456789`. ### `move-active-tag(uint tag)` @@ -61,4 +61,4 @@ Like `master`, but uses the active client. Example: `wormc master-active` ### `float(window id)` Change the mode of the client indicated by the provided window ID to floating. In a tiling layout, this would indicate that the provided window should not be tiled. TODO: have a way to reverse this affect. As an example: `wormc float 1234567890` ### `float-active()` -Like float, but floats the active client; eg `wormc float-active`. \ No newline at end of file +Like float, but floats the active client; eg `wormc float-active`. diff --git a/examples/rc b/examples/rc new file mode 100644 index 0000000..8188fef --- /dev/null +++ b/examples/rc @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +exec nitrogen --restore & + +exec polybar top -q -c ~/.config/worm/polybar/config.ini & + +exec mpd & + +exec sxhkd -c ~/.config/worm/sxhkdrc & + +wormc border-width 6 + +# These add support for pywal +# wormc active-border-pixel $((16$(sed -n '4p' .cache/wal/colors))) +# wormc inactive-border-pixel $((16$(sed -n '5p' .cache/wal/colors))) +# wormc background-pixel $((16$(sed -n '6p' .cache/wal/colors))) + +wormc layout tiling +wormc struts 75 20 20 20 +wormc gaps 20 +wormc frame-height 0 diff --git a/examples/sxhkdrc b/examples/sxhkdrc new file mode 100644 index 0000000..35ab10d --- /dev/null +++ b/examples/sxhkdrc @@ -0,0 +1,71 @@ +# Rofi +super + {p,w,x,s} + ~/.config/qtile/rofi/bin/{launcher,windows,powermenu,screenshot} + +# Launch Apps +super + shift + {f,w,e} + {kitty ranger,firefox,kitty nvim} + +super + Return + kitty + +# Take a screenshot +Print + scrot 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' + +# Take a screenshot in 5 second +alt + Print + scrot -d 5 'Screenshot_%Y-%m-%d-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' + +# Brighness control +XF86MonBrightnessUp + xbacklight -inc 10 + +XF86MonBrightnessDown + xbacklight -dec 10 + +# Volume control +XF86AudioRaiseVolume + amixer set Master 5%+ + +XF86AudioLowerVolume + amixer set Master 5%- + +XF86AudioMute + amixer set Master toggle + +# Restart worm +super + ctrl + r + worm + +# Quit worm +ctrl + alt + q + pkill worm + +# Close app +super + q + wormc close-active-client + +# Maximize app +super + f + wormc maximize-active-client + +# Switch active tag +super + {1,2,3,4,5,6,7,8,9} + wormc switch-tag {1,2,3,4,5,6,7,8,9} + +# Switch tag +super + shift + {1,2,3,4,5,6,7,8,9} + wormc move-active-tag {1,2,3,4,5,6,7,8,9} + +# Set master windows +super + m + wormc master-active + +# Float a window +super + shift + space + wormc float-active + +# Pywal apply +super + ctrl + w + ~/.config/worm/pywal.sh