Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e6b5f37
sticky center
hedning Aug 15, 2020
d54c6fc
Merge remote-tracking branch 'upstream/develop' into sticky-center
jtaala Mar 3, 2023
2e9e312
Updated sticky-center branch to latest code (and latest centering
jtaala Mar 3, 2023
9df98aa
Pressing the center-horizontally shortcut again results in
jtaala Mar 3, 2023
c2a33cd
Merge remote-tracking branch 'upstream/develop' into sticky-center
jtaala Mar 3, 2023
54afadb
Added FocusModes and new bindsym "toggle-focus-mode". Updated schema.
jtaala Mar 5, 2023
a74ecd9
Entering center mode now also centers selectedWindow as well.
jtaala Mar 5, 2023
1d82adf
Added simple "focus mode" icon in topbar (which shows current focus
jtaala Mar 5, 2023
75c48a9
Focus mode icon is now clickable and cycles through focus modes when
jtaala Mar 5, 2023
2f565f4
Now using a FocusIcon class to encapsulate icon logic. Added icon to
jtaala Mar 7, 2023
066b779
Hides space icons during normal view (designed to be shown during
jtaala Mar 7, 2023
215a722
Refactor naming to refer to "focus modes" in shortcuts and internally.
jtaala Mar 7, 2023
fbd225d
Merge branch 'develop' into sticky-center
jtaala Mar 11, 2023
4ddd68b
Switching back normal focus mode (from centering mode) will move the
jtaala Mar 11, 2023
a8577a1
Now uncentering treats the first or last window specially, lines up with
jtaala Mar 12, 2023
04aa77a
Refactor topbar.focusButton. Moved to after workspace name. Now the…
jtaala Mar 12, 2023
8e1f449
Small improvements to setters in FocusModeIcon.
jtaala Mar 12, 2023
bab268d
Refactor of space focus mode elements to allow clickability (on
jtaala Mar 12, 2023
96afb74
Workspace names on other monitors (e.g. secondary monitor etc.) is now
jtaala Mar 12, 2023
98409c1
Improved click detection of space elements. Refactor and moved
jtaala Mar 13, 2023
4ff5a15
Added dconf settable setting to show/hide the new focus mode icon (in
jtaala Mar 13, 2023
367f4b0
Now packaging focus mode icons instead of relying on system icons (which
jtaala Mar 13, 2023
50c8ca0
Cleanup and removal of unneeded code (from icon loading test).
jtaala Mar 13, 2023
a686b09
Added a focus mode icon "tooltip" (my version of one anyway).
jtaala Mar 14, 2023
0776e87
FIX: focus mode icon tooltip now showing on correct monitor (in
jtaala Mar 14, 2023
06f505a
Moved tooltip to FocusIcon. Now shows for other monitors too. Added
jtaala Mar 15, 2023
efbb81b
Update resources/ICONS.info
jtaala Mar 16, 2023
a67439f
Updated README.md with a section on focus modes (with picture). Adde…
jtaala Mar 16, 2023
5c5b215
Merge remote-tracking branch 'upstream/develop' into sticky-center
jtaala Mar 16, 2023
0153216
Small change to README.md.
jtaala Mar 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ Keybindings.bindkey("<Super>j", "my-favorite-width",

See `examples/keybindings.js` for more examples.

### Window Position Bar (colored bar segment added to Gnome Top Bar)
## Window Position Bar (colored bar segment in Top Bar)



[#476](https://github.com/paperwm/PaperWM/pull/476) added a coloured window position bar to the Gnome Top Bar. This allows users to visually identify the current selected window position of the scrollable viewport in the current workspace. This is demonstrated in the following video:

https://user-images.githubusercontent.com/30424662/221416159-464d7512-5174-451b-9035-0ee84f9eb4ec.mp4

The the window position bar can be _disabled_ from `PaperWM extension settings` or via `dconf`, e.g. by executing the following command a terminal:
The the window position bar can be _disabled_ from `PaperWM extension settings` or via `dconf`, e.g. by executing the following command in a terminal:

```
dconf write /org/gnome/shell/extensions/paperwm/show-window-position-bar false
Expand All @@ -292,6 +292,21 @@ You can style both the coloured position bar and the dimmed "position bar backdr

_Note: PaperWM overrides the default Gnome Top Bar style to be completely transparent so that the dimmed `window-position-bar-backdrop` and`window-position-bar` elements are visible._

## Window Focus Mode ##

[#482](https://github.com/paperwm/PaperWM/pull/482) added the concept of `window focus modes` to PaperWM. A `focus mode` controls how windows are "focused". For example, the `CENTER` focus mode causes all windows to be centered horizontally on selection, whereas the `DEFAULT` focus mode is the traditional PaperWM behaviour.

Focus modes can be toggled by user-settable keybinding (default is `Super`+`Shift`+`c`), or by clicking the new focus-mode button in the topbar:

![Focus mode button](media/focus-mode-button.png)

You may prefer to hide the focus mode icon. You can do so by executing the following command in a terminal:

```
dconf write /org/gnome/shell/extensions/paperwm/show-focus-mode-icon false
```


## Fixed Window Size ##

See the [Winprops](#winprops) section for a way to set the default _width_ of windows identified by their `wm_class` window property.
Expand Down
4 changes: 4 additions & 0 deletions keybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ function init() {
Scratch),
Meta.KeyBindingFlags.PER_WINDOW);

registerPaperAction("switch-focus-mode",
dynamic_function_ref("switchToNextFocusMode",
Tiling));

registerPaperAction("develop-set-globals",
dynamic_function_ref("setDevGlobals",
Utils));
Expand Down
Binary file added media/focus-mode-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var Minimap = class Minimap extends Array {
}

this.layout();
let time = animate ? 0.25 : 0;
let time = animate ? prefs.animation_time : 0;
this.actor.show();
Tweener.addTween(this.actor,
{opacity: 255, time, mode: Clutter.AnimationMode.EASE_OUT_EXPO});
Expand All @@ -131,7 +131,7 @@ var Minimap = class Minimap extends Array {
hide(animate) {
if (this.destroyed)
return;
let time = animate ? 0.25 : 0;
let time = animate ? prefs.animation_time : 0;
Tweener.addTween(this.actor,
{opacity: 0, time, mode: Clutter.AnimationMode.EASE_OUT_EXPO,
onComplete: () => this.actor.hide() });
Expand Down
2 changes: 1 addition & 1 deletion navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class NavigatorClass {
this._block = Main.wm._blockAnimations;
Main.wm._blockAnimations = true;
// Meta.disable_unredirect_for_screen(screen);
this.space = Tiling.spaces.spaceOf(workspaceManager.get_active_workspace());
this.space = Tiling.spaces.getActiveSpace();

this._startWindow = this.space.selectedWindow;
this.from = this.space;
Expand Down
1 change: 1 addition & 0 deletions prefsKeybinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const actions = {
'switch-last',
'live-alt-tab',
'live-alt-tab-backward',
'switch-focus-mode',
'move-left',
'move-right',
'move-up',
Expand Down
9 changes: 9 additions & 0 deletions resources/ICONS.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SVG icons adapted from `sidebar-show-right-symbolic.svg` and `preferences-desktop-multitasking-symbolic.svg` icons from "GNOME Project" adwaita-icon-theme (https://github.com/GNOME/adwaita-icon-theme).

See http://www.gnome.org for more information.

The icons are licensed under Creative Commons Attribution-Share Alike 3.0 United States License.

To view a copy of the CC-BY-SA licence, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
4 changes: 4 additions & 0 deletions resources/focus-mode-center-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/focus-mode-default-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified schemas/gschemas.compiled
Binary file not shown.
12 changes: 11 additions & 1 deletion schemas/org.gnome.shell.extensions.paperwm.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<default><![CDATA[['<Super>t']]]></default>
<summary>Take the window, dropping it when finished navigating</summary>
</key>

<key type="as" name="switch-focus-mode">
<default><![CDATA[['<Super><Shift>c']]]></default>
<summary>Switch between Window Focus Modes (e.g. default, center)</summary>
</key>

<key type="as" name="switch-next">
<default><![CDATA[['<Super>period']]]></default>
Expand Down Expand Up @@ -243,7 +248,7 @@
</key>
<key type="b" name="show-top-bar">
<default>true</default>
<summary>Wether to hide the top bar or not</summary>
<summary>Show the topbar</summary>
</key>
<key type="s" name="color">
<default>''</default>
Expand Down Expand Up @@ -374,6 +379,11 @@
<summary>Show the window position bar in the topbar</summary>
</key>

<key type="b" name="show-focus-mode-icon">
<default>true</default>
<summary>Show the focus mode icon in the topbar</summary>
</key>

<key type="d" name="animation-time">
<default>0.25</default>
<summary>Duration of animations in seconds</summary>
Expand Down
2 changes: 1 addition & 1 deletion settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var prefs = {};
'workspace-colors', 'default-background', 'animation-time', 'use-workspace-name',
'pressure-barrier', 'default-show-top-bar', 'swipe-sensitivity', 'swipe-friction',
'cycle-width-steps', 'cycle-height-steps', 'topbar-follow-focus', 'minimap-scale',
'winprops', 'show-window-position-bar']
'winprops', 'show-window-position-bar', 'show-focus-mode-icon']
.forEach((k) => setState(null, k));

prefs.__defineGetter__("minimum_margin", function() { return Math.min(15, this.horizontal_margin) });
Expand Down
22 changes: 22 additions & 0 deletions stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
.space-label-wrapper {
padding: 0 10px 0 0;
background-color: transparent;
border-image: none;
background-image: none;
border: none;
}

.space-focus-mode-icon {
icon-size: 16px;
padding: 0 18px 0 18px;
margin-left: 3px;
background-color: transparent;
}

.focus-button-tooltip {
background-color: rgba(0, 0, 0, 0.7);
padding: 8px;
border-radius: 8px;
font-weight: 600;
}

.topbar-clear {
background-color: rgba(0, 0, 0, 0);
}
Expand Down
Loading