Code Monkey home page Code Monkey logo

forge's Introduction

Forge

Forge is a GNOME Shell extension that provides tiling/window management.

Features

  • Tree-based tiling with vertical and horizontal split containers similar to i3-wm
  • Vim-like keybindings for navigation/swapping windows/moving windows in the containers
  • Drag and drop tiling
  • Support for floating windows, smart gaps and focus hint
  • Customizable shortcuts in extension preferences
  • Some support for multi-display
  • Tiling support per workspace
  • Update hint color scheme from Preferences
  • Stacked tiling layout
  • Works on GNOME 3.36+ (feature-freeze) and 40. X11 and Wayland
  • Swap current window with the last active window
  • Auto Split or Quarter Tiling
  • Show/hide tab decoration via keybinding #180
  • Window resize using keyboard shortcuts

Known Issues / Limitations

  • Does not support dynamic workspaces
  • Does not support vertical monitor setup

Installation

image

Forge Keybinding Defaults

See the acceptable key combinations on the wiki

Action Shortcut
Increase active window size left <Ctrl> + <Super> + y
Decrease active window size left <Ctrl> + <Shift> + <Super> + o
Increase active window size bottom <Ctrl> + <Super> + u
Decrease active window size bottom <Ctrl> + <Shift> + <Super> + i
Increase active window size top <Ctrl> + <Super> + i
Decrease active window size top <Ctrl> + <Shift> + <Super> + u
Increase active window size right <Ctrl> + <Super> + o
Decrease active window size right <Ctrl> + <Shift> + <Super> + y
Open preferences <Super> + period
Toggle tiling mode <Super> + w
Focus left <Super> + h
Focus right <Super> + l
Focus up <Super> + k
Focus down <Super> + j
Swap current window with last active <Super> + Return
Swap active window left <Ctrl> + <Super> + h
Swap active window right <Ctrl> + <Super> + l
Swap active window up <Ctrl> + <Super> + k
Swap active window down <Ctrl> + <Super> + j
Move active window left <Shift> + <Super> + h
Move active window right <Shift> + <Super> + l
Move active window up <Shift> + <Super> + k
Move active window down <Shift> + <Super> + j
Split container horizontally <Super> + z
Split container vertically <Super> + v
Toggle split container <Super> + g
Gap increase <Ctrl> + <Super> + Plus
Gap decrease <Ctrl> + <Super> + Minus
Toggle focus hint <Super> + x
Toggle active workspace tiling <Shift> + <Super> + w
Toggle stacked layout <Shift> + <Super> + s
Toggle tabbed layout <Shift> + <Super> + t
Show/hide tab decoration <Ctrl> + <Alt> + y
Activate tile drag-drop Start dragging - Mod key configuration in prefs
Snap active window left two thirds <Ctrl> + <Alt> + e
Snap active window right two thirds <Ctrl> + <Alt> + t
Snap active window left third <Ctrl> + <Alt> + d
Snap active window right third <Ctrl> + <Alt> + g
Persist toggle floating for active window <Super> + c
Persist toggle floating for active window and its window class <Super><Shift> + c

For any shortcut conflicts, the user has to manually configure those for now from the GNOME Control Center > Keyboard > Customize Shortcuts. #37

Forge Override Paths

  • Window Overrides: $HOME/.config/forge/config/windows.json
  • Stylesheet Overrides: $HOME/.config/forge/stylesheet/forge/stylesheet.css

GNOME Defaults

GNOME Shell has built in support for workspace management and seems to work well - so Forge will not touch those.

User is encouraged to bind the following:

  • Switching/moving windows to different workspaces
  • Switching to numbered, previous or next workspace

Development

  • The main branch contains gnome-4x code.
  • The legacy and gnome-3-36 are the same and is now the source for gnome-3x.

Local Development Setup

  • Install NodeJS 16+
  • Install gettext
  • Run npm install
  • Commands:
# Compile and override the gnome-shell update repo
make dev

# Or run below, and restart the shell manually
make build && make debug && make install

# X11 - build from source and restarts gnome-shell
make test-x

# Wayland - build from source and starts a wayland instance (no restart)
make test-wayland

# Formatting, when you do npm install, 
# husky gets installed should force prettier formatting during commit

npm run format

Contributing

  • Please be nice, friendly and welcoming on discussions/tickets.
  • See existing issues or file a new ticket with title bug: short description if it doesn't exist.

Credits

Thank you to:

  • Forge extension contributors
  • Michael Stapelberg/contributors for i3
  • System76/contributors for pop-shell
  • ReworkCSS/contributors for css-parse/css-stringify

forge's People

Contributors

albanobattistella avatar alesya-h avatar andrewkvalheim avatar azakidev avatar batwam avatar bennypowers avatar bon-sai-tree avatar carlwgeorge avatar cgross95 avatar dependabot[bot] avatar hus3h avatar jmmaranan avatar juarezr avatar kitlaan avatar matdave avatar moritztim avatar p1gp1g avatar vistaus avatar wedoneofficiel avatar wroyca avatar xalt7x 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

forge's Issues

feat: handle enable/disable of the extension

  • Cleanup the signals on disable
  • Rebind the signals on enable
  • Remove the active window border on disable
  • Show the active window border on enable
  • Remove any keybindings on disable
  • Rebind any keybindings on enable

floating or minimizing resized windows should not take space

  • After implementing resizing, floating or minimizing windows leaves a space probably because of the existing percentages > 0.0 between the window that was resized and the sibling.
  • Also, handle the window that was split and is the only child of that parent con.

feat: still move window as first or last child of a container

When moving windows with keybindings, and the window being moved is within another sub-con, and the sub-con is the first or last child of a container, still move the window as the first or last child, detaching from that sub-con.

One use case is when inserting a window into a split and would like to go back to the same position as it was before.

does not handle dynamic workspaces option in Tweaks

When the dynamic workspaces is turned on in GNOME Tweaks or gsettings, and moving windows in and out of workspaces sometimes produces display glitches after introducing the container splits:

  • Windows overlap each other
  • Windows gets detached on the tree

feat(window-mgt): navigate windows via vim/directional keys

Use <Super> + vim or directional keys to navigate windows:

  • h / left arrow keys - move focus to left of currently focused window
  • j / down arrow keys - move focus to bottom of currently focused window
  • k / up arrow keys - focus window to top of currently focused window
  • l / right arrow keys - focus window to right of currently focused window

feat: Enable for specific workspace

First of all...great work!

Would be great if you could bound Forge functionality to one of more workspaces, leaving other workspaces function normally. The use case is I have coding workscapes and design workspaces. The design workspaces need a more mouse-driven and flexible workflow.

tiling overlaps auto-hide panels

On Zorin16 presets got a floating top bar, when im try to activate this extensions it ignores the topbar of gnome and hide the titlebar of the windows under it. If i activate the gap i can manage to mitigate this problem but doesn't solve it. The way that i can see this thing solved is (and i suggest):

1: have an gap exclusive to the top on the extension settings
2: manage to recognize the modified top bar of Zorin16

Especially on the second sugestion its only an way to say it, i dont know nothing about how to do it or even if its possible. I could share any other info needed for resolve this problem. I really apreciatte the effort on this extension.

Some additional info:
Gnome version: 3.38 on Wayland

feat: allow to select parent con node for management

When pressing <Super> + z, select the parent con of the focused window. The con is a St.Bin, can implement active hint and hiding the border on the focused window.

With this, open up to be able to move/update this Con and its children using drag/drop or keyboard shortcuts

feat: implement prefs.js

Add the following configurable settings in prefs.js, with the ability to:

  • Adjust keyboard shortcuts
  • Adjust window gaps sizes
  • Open up prefs.js via <Super> + .
  • Adjust developer logging levels

The idea is to self-contain the UI for the options - so it can be available for users in any distro that is using Gnome-Shell.

feat: implement tabbed layout using exist window deco

When pressing <Super><Shift> + t, toggle the current focus window's parent con to Tabbed layout.

Two options for tabs:

  • The tabbed layout is currently using the existing window decorations as tabs
    • First problem with this is that not all windows can have the same width size due to some windows having preferred width sizes. Or resize = false for some.
    • Second problem is that the active tab is not going to be present on the remaining background tabs. And it looks weird :)
  • #63
    • It looks like there is no built in tab/notebook yet in St library - so I have to make one myself.
    • Second note: find the current stylesheet class for the window decoration in gnome-shell - so when distros change their styles, the tab also follows the same style decoration as if it was implemented like the first approach on the native window decorations. Use case, distros can change the GTK theme (at the moment) or light and dark. Will have to wait for libadwaita but that's another challenge for the future :)

feat: implement panel icon

Capability to see the panel icon for the following:

  • tiling toggle in panel button
  • workspace tiling toggle in panel button
  • workspace layout mode in panel button
  • open prefs shortcut in panel button
  • show version number in panel button

feat: handle workspace / display monitor updates

  • Update tree when workspace changes: static and dynamic
  • Update tree when monitor or display changes
  • Handle moving windows to different workspaces
  • Handle moving windows to different monitors or displays

feat: when focus switches, focus on the proper window

  • When the focus switches via Focus command and same orientation as the direction, and the next monitor contains 1 or more windows, focus on the node window that's closest to the previous monitor. (The last index of the child of next con can be used if coming from direction == RIGHT, else first index)
  • When not the same orientation as the direction, focus on the same position of the previous window. (The previous index can be used here, if the next and previous number of siblings are not the same, use the lower valued index)

feat: adjust focus color and highlights in prefs.js

  • The focus hint is defined the same as window-clone-border class name in the stylesheet.css.
  • The highlights are the active and focus hovers in the overview app icons, search and workspace thumbnails as shown below:
    Screenshot from 2021-09-06 09-52-58
    Screenshot from 2021-09-06 09-53-25
    Screenshot from 2021-09-06 09-53-49
    Screenshot from 2021-09-06 09-54-08

feat: detect keybinding conflicts in prefs.js

  • When GNOME or third party schemas have already bound the same keys as Forge, provide conflict detection and inform the user on the Forge Preferences > Keyboard > {Windows|Container|Other} Shortcuts > Conflicts With column.
  • Provide the ability to remove the conflicting binding in favor of Forge?

bug: calculate the attachNode properly

When moving to an empty workspace and have done tiling on a different workspace, the window does not attach to the empty workspace-monitor node properly. It tiles on the previous workspace's attachNode.

feat(window-mgt, keybindings): handle split containers horizontally/vertically

Control where new window would appear, horizontally or vertically against a focused window. This is inspired by i3-wm:

  • Use <Super> + z to ready create a horizontal split.
  • Use <Super> + v to ready create a vertical split.
  • Highlight the direction of the split

Document any conflicting keybindings on the gnome.wm or desktop.wm dconf

do not swap windows on overview

When overview is opened, and mouse is moved to another window than previous, the previous and currently highlighted window gets swapped when closing the overview.

bug: deeply nested nodes with minimized windows

While working on #22 - found out that when minimizing deeply nested windows, the tree.next is not able to determine the next available window for the remaining tiled children shown on the screen.

Bugs as part of this ticket:

  • If there are 3 cons and all the windows of the middle con is minimized, next is not able to jump to the next con.
  • Unable to resize when the resize pair is a hidden window

toggle layout of any pair con or window breaks resizing

Open 2 windows, halt-tile vertically 1 window and toggle the layout. Resize the con and see it break. Resize by dragging one of the children opposite the split direction - since vertical, drag horizontally or vice versa.

feat: implement floating window exceptions

Add capability to exempt some windows from being tracked for layout (tiling, tabbed or stacked) by Forge:

  • Provide a keyboard shortcut to exempt the current window (<Super> + e) or its entire wm_class (<Super><Shift> + e).
  • Exempt Forge window components by default. Users can still update these.
  • Open the prefs.js, tabbing to the Exemptions section by default. Keyboard shortcut <Super><Shift> + z.
  • Users should be able to edit the defaults and add/update any windows (wm_class, title) as they wish.
  • #132
  • #133

unable to determine attach node properly on second monitor

Due to the change in 84fde5c for detecting if window is in the same monitor workspace node, the attachNode is being overriden incorrectly when the window swaps in between displays.

It behaves as if the window was just dragged into the monitor even if Split Vertical or Split Horizontal is done by the user.

feat: move-insert windows using keyboard and mouse

Today, grabbing mouse and keyboard shortcuts swaps the windows.

  • Move windows inside a con and swap when the next sibling is the last item.
  • This also allows a window inside a con to move out and remove the con if it is the last window.
  • Use <Super> + <Shift> + hjkl to move-insert windows.
  • Use <Super> + <Ctrl> + hjkl to swap windows.

feat(window-mgt, keybindings): handle floating windows

  • Toggle float Window via title <Super> + c and add wm_class and wm_title to floating overrides config file.
  • Toggle float Window and its entire wm_class via <Super> + <Shift> + c and add wm_class to floating overrides config file.

see #15

bug: when closing the last window with a confirmation dialog crashes forge

To reproduce, open any window that has a confirmation dialog when exiting. I see this on GNOME Terminal with tmux and then exiting while tmux is still running, then it will ask to confirm the exit. After confirming exit and terminal is the last window in Forge, it crashes and restarts gnome-shell

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.