├── LICENSE ├── Makefile ├── README.md ├── bin └── nowm ├── examples ├── autostart └── sxhkdrc ├── logo.svg ├── man └── nowm.1 └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Kazoku 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX ?= /usr/local 2 | MANDIR ?= $(PREFIX)/share/man 3 | BIN ?= nowm 4 | 5 | install: 6 | @mkdir -p $(PREFIX)/bin 7 | @mkdir -p $(MANDIR)/man1 8 | 9 | @cp -p bin/$(BIN) $(PREFIX)/bin/ 10 | @cp -p man/$(BIN).1 $(MANDIR)/man1/ 11 | 12 | @chmod 755 $(PREFIX)/bin/$(BIN) 13 | 14 | 15 | uninstall: 16 | @rm -rf $(PREFIX)/bin/$(BIN) 17 | @rm -rf $(MANDIR)/man1/$(BIN).1* 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

nowm

2 |

Managing window without a window manager

3 |

4 | 5 | 6 | 7 |

8 | 9 | ## 💡 About 10 | 11 | A dead simple tool to managing windows from the [tty](https://en.wikipedia.org/wiki/Tty_(Unix)), written in shell script. 12 | 13 | ### ✨ Features 14 | 15 | - No [virtual desktops](https://en.wikipedia.org/wiki/Virtual_desktop). 16 | - No [window decorations](https://en.wikipedia.org/wiki/Window_(computing)#Window_decoration). 17 | - No [widgets](https://nnbnh.github.io/blog/en/posts/5/#widgets). 18 | - No [hotkeys](https://nnbnh.github.io/blog/en/posts/5/#hotkeys). 19 | - No [wallpaper](https://nnbnh.github.io/blog/en/posts/5/#wallpaper). 20 | - No [ICCCM](https://web.archive.org/web/20190617214524/https://raw.githubusercontent.com/kfish/xsel/1a1c5edf0dc129055f7764c666da2dd468df6016/rant.txt). 21 | - No [EWMH](https://en.wikipedia.org/wiki/Extended_Window_Manager_Hints). 22 | - And everything is float. 23 | 24 | ## 🚀 Setup 25 | 26 | ### 🧾 Dependencies 27 | 28 | - [`sh`](https://en.wikipedia.org/wiki/Unix_shell) 29 | - [`xorg`](https://www.x.org) 30 | - [`xorg-xinit`](https://x.org/releases/X11R7.6/doc/man/man1/xinit.1.xhtml) _(optional)_ 31 | - [`xdotool`](https://github.com/jordansissel/xdotool) 32 | 33 | ### 📥 Installation 34 | 35 | #### 🔧 Manually 36 | 37 | Option 1: using `curl` 38 | 39 | ```sh 40 | curl https://raw.githubusercontent.com/K4zoku/nowm/master/bin/nowm > ~/.local/bin/nowm 41 | chmod +x ~/.local/bin/nowm 42 | ``` 43 | 44 | Option 2: using `git` 45 | 46 | ```sh 47 | git clone https://github.com/K4zoku/nowm.git ~/.local/share/nowm 48 | ln -s ~/.local/share/nowm/bin/nowm ~/.local/bin/nowm 49 | ``` 50 | 51 | #### 📦 Package manager 52 | 53 | For [Bpkg](https://github.com/bpkg/bpkg) user: 54 | 55 | ```sh 56 | bpkg install K4zoku/nowm 57 | ``` 58 | 59 | For [Basher](https://github.com/basherpm/basher) user: 60 | 61 | ```sh 62 | basher install K4zoku/nowm 63 | ``` 64 | 65 | Using [Arch User Repository](https://aur.archlinux.org): 66 | 67 | First of all you need to have `base-devel` group installed as it contains necessary utilities - `sudo pacman -Syu base-devel`. There are two packages providing NoWM - [nowm](https://aur.archlinux.org/packages/nowm) (stable release) and [nowm-git](https://aur.archlinux.org/packages/nowm-git) (latest commits). Choose which one you want to install and use your preferred AUR helper, eg: 68 | 69 | ```sh 70 | yay -S nowm-git 71 | ``` 72 | 73 | or install it manually using `makepkg` command: 74 | 75 | ```sh 76 | git clone https://aur.archlinux.org/packages/nowm-git 77 | cd nowm-git 78 | makepkg -si 79 | ``` 80 | 81 | > **Note** If you can and want to port NoWM to other package managers, feel free to do so. 82 | 83 | ## ⌨️ Usage 84 | 85 | #### 🖥️ Launch from TTY 86 | 87 | ##### Automatically 88 | 89 | Simply launch it from the [tty](https://en.wikipedia.org/wiki/Tty_(Unix)): 90 | 91 | ```sh 92 | nowm 93 | ``` 94 | 95 | this will launch NoWM inside X display server with `startx`. 96 | 97 | ##### Manually 98 | 99 | ```sh 100 | startx $(which nowm) 101 | ``` 102 | 103 | or 104 | 105 | ```sh 106 | xinit $(which nowm) 107 | ``` 108 | 109 | or 110 | 111 | You can put NoWM inside `~/.xinitrc`: 112 | 113 | ```sh 114 | exec nowm 115 | ``` 116 | 117 | ### Using display manager 118 | 119 | If you using a display manager, create a file called `nowm.desktop` in `/usr/share/xsessions` with following content: 120 | 121 | ```ini 122 | [Desktop Entry] 123 | Encoding=UTF-8 124 | Name=nowm 125 | Comment=nowm - managing window without a window manager 126 | Exec=nowm 127 | Type=XSession 128 | ``` 129 | 130 | ## ⚙️ Configuration 131 | 132 | To config NoWM, you can make a *executable file* at `~/.config/nowm/autostart`, NoWM will automatically start it at runtime. 133 | 134 | > **Note** Check out some [examples](examples). 135 | 136 | ## 💌 Credits 137 | 138 | Special thanks to: 139 | - [**NNB**](https://github.com/NNBnh) for polish this project's `README.md`, write the manpage and design [new logo](https://www.figma.com/file/NuxUjGNgfnCZ5fY5Q554ME/NoWM-Logo?node-id=0%3A1). 140 | 141 |



142 | 143 | --- 144 | 145 | >

Made with ❤️ by @K4zoku

146 | -------------------------------------------------------------------------------- /bin/nowm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | resize() { xdotool getwindowfocus windowsize "${1:-0}" "${2:-0}"; } 4 | 5 | resize_relative() { 6 | eval "$(xdotool getwindowfocus getwindowgeometry --shell | head -n5)" 7 | W_WIDTH=$(( WIDTH + "${1:-0}" )); W_HEIGHT=$(( HEIGHT + "${2:-0}" )) 8 | eval "$(xdotool getdisplaygeometry --shell)" 9 | DR_WIDTH="$(( WIDTH - X ))"; DR_HEIGHT="$(( HEIGHT - Y ))" 10 | [ "${W_WIDTH}" -lt 1 ] && W_WIDTH=1 || [ "${W_WIDTH}" -gt "${DR_WIDTH}" ] && W_WIDTH="${DR_WIDTH}" 11 | [ "${W_HEIGHT}" -lt 1 ] && W_HEIGHT=1 || [ "${W_HEIGHT}" -gt "${DR_HEIGHT}" ] && W_HEIGHT="${DR_HEIGHT}" 12 | xdotool windowsize "${WINDOW}" "${W_WIDTH}" "${W_HEIGHT}" 13 | } 14 | 15 | move() { xdotool getwindowfocus windowmove "${1:-0}" "${2:-0}"; } 16 | 17 | move_relative() { xdotool getwindowfocus windowmove --relative "${1:-0}" "${2:-0}"; } 18 | 19 | center() { 20 | eval "$(xdotool getwindowfocus getwindowgeometry --shell | tail -n3 | head -n2)" 21 | W_WIDTH="${WIDTH}"; W_HEIGHT="${HEIGHT}" 22 | eval "$(xdotool getdisplaygeometry --shell)" 23 | move "$(( (WIDTH - W_WIDTH) / 2 ))" "$(( (HEIGHT - W_HEIGHT) / 2 ))" 24 | } 25 | 26 | snap() { 27 | eval "$(xdotool getwindowfocus getwindowgeometry --shell | head -n5)" 28 | W_WIDTH="${WIDTH}"; W_HEIGHT="${HEIGHT}" 29 | eval "$(xdotool getdisplaygeometry --shell)" 30 | case "${1:-0}" in 31 | left) move 0 y ;; 32 | bottom) move x "$(( HEIGHT - W_HEIGHT ))";; 33 | top) move x 0 ;; 34 | right) move "$(( WIDTH - W_WIDTH ))" y ;; 35 | *) move x y ;; 36 | esac 37 | } 38 | 39 | pointer_focus() { xdotool getmouselocation windowfocus; } 40 | 41 | select_focus() { xdotool selectwindow windowfocus; } 42 | 43 | close() { xdotool getwindowfocus windowclose; } 44 | 45 | quit() { xdotool getwindowfocus windowquit; } 46 | 47 | window_kill() { xdotool getwindowfocus windowkill; } 48 | 49 | nowm_logout() { pkill -KILL -u "$(whoami)"; } 50 | 51 | nowm_main() { 52 | NOWM_AUTOSTART="${XDG_CONFIG_HOME:-${HOME}/.config}/nowm/autostart" 53 | [ -x "${NOWM_AUTOSTART}" ] && "${NOWM_AUTOSTART}" >/dev/null 2>&1 & 54 | while : ; do : ; done 55 | } 56 | 57 | noargs() { if [ -z "${DISPLAY}" ]; then exec startx "$(which nowm)"; else nowm_main; fi; } 58 | 59 | case "${1}" in 60 | "") noargs || exit 1 ;; 61 | resize) resize "${2}" "${3}";; 62 | resize_relative) resize_relative "${2}" "${3}";; 63 | move) move "${2}" "${3}";; 64 | move_relative) move_relative "${2}" "${3}";; 65 | center) center ;; 66 | snap) snap "${2}" ;; 67 | pointer_focus) pointer_focus ;; 68 | select_focus) select_focus ;; 69 | close) close ;; 70 | quit) quit ;; 71 | kill) window_kill ;; 72 | logout) nowm_logout ;; 73 | *) exit 1 ;; 74 | esac 75 | -------------------------------------------------------------------------------- /examples/autostart: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pgrep -x sxhkd || sxkhd -c "${NOWM_CONFIG_HOME}/sxhkdrc" & 4 | -------------------------------------------------------------------------------- /examples/sxhkdrc: -------------------------------------------------------------------------------- 1 | ########################## 2 | # WM INDEPENDENT HOTKEYS # 3 | ########################## 4 | 5 | # terminal 6 | super + Return 7 | urxvt 8 | 9 | # reload sxhkd configuration files 10 | super + Escape 11 | pkill -USR1 -x sxhkd 12 | 13 | ################ 14 | # NOWM HOTKEYS # 15 | ################ 16 | 17 | # [nowm] logout 18 | super + alt + q 19 | nowm logout 20 | 21 | # [nowm] move 22 | super + {Left,Down,Up,Right} 23 | nowm move_relative {-4 0, 0 4, 0 -4, 4 0} 24 | 25 | # [nowm] resize 26 | super + {a,s,w,d} 27 | nowm resize_relative {-4 0, 0 4, 0 -4, 4 0} 28 | 29 | # [nowm] window close 30 | super + w 31 | nowm close 32 | 33 | # [nowm] focus 34 | ~button1 35 | nowm pointer_focus 36 | -------------------------------------------------------------------------------- /logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /man/nowm.1: -------------------------------------------------------------------------------- 1 | .TH NOWM "1" "2022" "K4zoku" "User Commands" 2 | .SH NAME 3 | NoWM \- Managing window without a window manager 4 | .SH SYNOPSIS 5 | .B nowm 6 | .SH DESCRIPTION 7 | A dead simple tool to managing windows from the tty, written in shell script. 8 | .SH OPTIONS 9 | \fBresize\fR \fBw h\fR 10 | Shrink or grow the current window by the given w/h arguments 11 | .TP 12 | \fBresize_relative\fR \fBw h\fR 13 | Shrink or grow the current window relatively by the given w/h arguments 14 | .TP 15 | \fBmove\fR \fBx y\fR 16 | Shift the current window by the given x/y coordinates 17 | .TP 18 | \fBmove_relative\fR \fBx y\fR 19 | Shift the current window relatively by the given x/y coordinates 20 | .TP 21 | \fBcenter\fR 22 | Centers the current window. 23 | .TP 24 | \fBsnap\fR \fB(top|bottom|left|right)\fR 25 | Move and resize the current window to fill the DIRECTION half of the screen 26 | .TP 27 | \fBpointer_focus\fR 28 | Focus the window underneath the pointer 29 | .TP 30 | \fBselect_focus\fR 31 | Focus selected window 32 | .TP 33 | \fBclose\fR 34 | Destroy the window but will not try to kill the client controlling it 35 | \fBquit\fR 36 | Close window gracefully, this action sends a request, allowing the application to apply close confirmation mechanics 37 | \fBkill\fR 38 | Destroy the window and kill the client controlling it 39 | \fBlogout\fR 40 | Log user out 41 | .SH REPORTING BUGS 42 | Report bugs to https://github.com/K4zoku/nowm/issues 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nowm", 3 | "version": "0.0.1", 4 | "description": "Managing window without a window manager", 5 | "global": "true", 6 | "scripts": ["bin/nowm"], 7 | "files": ["man/nowm.1"], 8 | "install": "make install" 9 | } 10 | --------------------------------------------------------------------------------