Code Monkey home page Code Monkey logo

pixel-saver's Introduction

Pixel Saver

Pixel Saver is an extension for Gnome Shell that merge the activity bar and the title bar of maximized window. It is especially interesting for small screens, but MOAR pixels for your apps is always good!

The extension has no configuration. Its behavior is made to mimic the one of the title bar and settings affecting the title bar should reflect in Pixel Saver. It Just Works!

For applications using the modern GTK header bar, there are no space savings, but the application title is still displayed in the top panel to achieve a uniform appearance.

The title bar is completely gone and integrated to the activity bar.

It is largely inspired by bios and mathematicalcoffee's Window Buttons Extension and mathematicalcoffee's maximus extension and some code come from there. You may want to check theses out, especially if you want something more configurable.

Get it!

Gnome Shell version Pixel saver version Recommended installation method
43 1.30 GNOME extensions
42 1.28 GNOME extensions
41 1.26 GNOME extensions
40 1.24 GNOME extensions
3.38 1.24 GNOME extensions
3.36 1.24 GNOME extensions
3.34 1.24 GNOME extensions
3.32 1.20 GNOME extensions
3.30 1.18 GNOME extensions
3.26 1.14 GNOME extensions
3.24 1.12 GNOME extensions
3.15 1.10 GNOME extensions
3.14 1.5.1 GNOME extensions
3.12 1.3 GNOME extensions

Pixel saver has been available for a long time on GNOME Extensions website (so it is on GNOME Software, too).

Manual install

From graphical interface

  • (eventually) switch to the tag for your version from this page;
  • download the repo's zip from the green button;
  • navigate from your home to the gnome shell extension directory .local/share/gnome-shell/extensions;
  • unzip the [email protected] directory in extension directory;
  • reload gnome-shell pressing Alt + F2 and entering r;
  • enable the extension using GNOME Tweaks.

From terminal

    # Clone repository
    git clone https://github.com/deadalnix/pixel-saver.git

    # Enter cloned directory
    cd pixel-saver

    # Switch to the proper tag
    git checkout tags/1.24

    # copy to extensions directory
    cp -r [email protected] -t ~/.local/share/gnome-shell/extensions

    # You may need to reload GNOME Shell to recognise new extension by
    # hitting Alt + F2 and entering "r"

    # activate 
    # GNOME <3.38
    gnome-shell-extension-tool -e [email protected]
    # GNOME >= 3.38
    gnome-extensions enable [email protected]

Dependencies

Pixel Saver depends on Xorg's xprop and xwininfo utilities. If not already present on your system, these can be installed using:

  • Debian/Ubuntu: apt install x11-utils
  • Fedora/RHEL: dnf install xorg-x11-utils
  • Arch: pacman -S xorg-xprop

Wayland

Since this extension relies on features provided by X.org, by default it won't work on GTK 3.x+ windows in wayland sessions. Neverthless, you can still run any GTK application in x11 mode setting the GDK_BACKEND variable to x11, i.e.

GDK_BACKEND=x11 <application_name>

on the opposite, QT applications need the variable QT_QPA_PLATFORM to be set to wayland to not run in x11 mode.

If you need a particular program to always run in a given mode, copy its desktop file from /usr/share/applications to your user XDG applications directory (~/.local/share/applications) and edit the Exec line to look like this one

Exec=env GDK_BACKEND=x11 <your_application>

then run update-desktop-database to refresh menu entries.

Configuration

Soon!

Screenshots

If you want to see what the full desktop look like with this extension, you can check out what a unmaximized window looks like, as well as a maximized one.

pixel-saver's People

Contributors

adaliszk avatar bitixel avatar bytbox avatar caiocarrara avatar chazzbg avatar deadalnix avatar echo-devim avatar eosis avatar godlyranchdressing avatar highvoltage avatar jimver avatar jubnzv avatar lburgazzoli avatar matthijskooijman avatar michaelaquilina avatar mrpjer avatar mwcz avatar polter-rnd avatar rahilwazir avatar robingrenet avatar ruiguilherme avatar sagebind avatar silentboatman avatar sinbirb avatar soumyac1999 avatar sumanta23 avatar tallero avatar timzava avatar zapashcanon avatar zvictor 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

pixel-saver's Issues

Have windows controls in application menu

Clicking on the title bar section in the activity bar for a maximized window (with pixel-saver) should show the same context menu that would be shown when right-clicking on the title bar of a maximized window (without pixel-saver). Instead, Gnomes normal context menu, which only offers a "Quit" option, is shown.

Launching some windows uses 100% CPU.

I ran into an issue with launching spotify with pixel-saver enabled. Calling win.get_compositor_private() in line 207 of decoration.js for this window always returns nil. This gets pixel-saver stuck in an infinite loop of calling onWindowAdded, using 100% CPU.

There should probably be some sort of max retries there. Simply disabling the callback to onWindowAdded() with return false; after the if (!win.get_compositor_private()) { call is a workaround, but probably not the right solution.

Thanks!

Running under 3.10 I get close, min, max, close buttons?!

First: THANK YOU for this antidote to Gnome's obsession with taking up all a user's vertical screen space.

I've just installed under Gnome 3.10 (as part of Ubuntu Gnome 14.04 Trusty) from the master branch (the 1.2 branch was greyed out in tweak tool saying incompatible version), and it works fine except that I get a duplicated close button

Screenshot:
screenshot-2014-05-07-004-thumb

(Could this be because I have overridden gnome's buttons options to provide them all on the left?)

Woun't work for me

Non-maximized:
pixel-saver

Maximized:
2014-02-09 01 06 02

So, title-bar doesn't dissapears, while additional buttons in activity bar are showed.

Ubuntu 13.10
Shell version: 3.8.4
Extension version: 2 (from metadata.json), installed from https://extensions.gnome.org

I tried with gdm and Lightdm with no success.
Maybe that's somehow related with my 2-monitor configuration.

Also, I've found following comment in decoration.js:

 * **Caveat**: doesn't work with Ubuntu's Ambiance and Radiance window themes -
 * my guess is they don't respect or implement this property.

3.20 compatibility

(At least for me) the only change necessary to get this to work with 3.20 is to add it to the version list in metadata.json.

Title in activity bar not updated when fullscreen-ing with mouse

If I fullscreen a window with the Super-Up shortcut or by double clicking the title bar, the activity bar is properly updated (showing the full window title).
But if I fullscreen a window by dragging its title bar to the top, the activity bar still shows the default application name.

It looks like it could be a bug in GNOME (version 3.18.2 from Fedora 23). window.get_maximized() in Util.getWindow() does think that the upper window is not maximized at this point. I guess it means that the signal is sent too early when the fullscreen is made by dragging with the mouse.
But I'll let you diagnose (in case I missed something) and decide if that is to be reported upstream (if you do, could you post the GNOME bug report here too please?).

Fullscreen by dragging to the top of the screen with mouse (wrong):
screenshot from 2015-12-12 15-34-49

Fullscreen by Super+Up or double clicking on the title bar (correct):
screenshot from 2015-12-12 15-34-55

Thanks.

Doesn't work properly on Gnome 3.12

By default, some apps start maximized. E.g. firefox. This is what happens : http://puu.sh/83f79.png

The decoration bar is displayed (but it shouldn't), but so are the pixel-saver buttons. If I reduce the window and the maximize it back, it works fine. Sometimes changing the focus to another window fixes it too.

Also, when the decoration bar is displayed, the buttons don't work.

titlebar from kate (kde-editor) is not removed

Hi,
im using debian jessie with gnome 3.14 and this extension is working great except that it is not working with the editor kate.
If i activate logging i get the following output:

Gjs-Message: JS LOG: [pixel-saver]: Override title Untitled – Kate
Gjs-Message: JS LOG: [pixel-saver]: Could not find XID for window with title Untitled – Kate
Gjs-Message: JS LOG: [pixel-saver]: Could not find XID for window with title Untitled – Kate
Gjs-Message: JS LOG: [pixel-saver]: Could not find XID for window with title Untitled – Kate
Gjs-Message: JS LOG: [pixel-saver]: Finding XID for window Untitled – Kate failed

The error catched at line 47 of the file decoration.js is:
Error: Failed to convert UTF-8 string to JS string: Ungültige Bytefolge in Konvertierungseingabe

other kde applications (i ve tested kile or okular) got their titlebar removed.
Thanks

edit: i ve solved the issue... kde applications need a seperate language pack installed... in my case kde-l10n-de

Don't show window buttons in panel

Is there a way not to show window buttons in the panel all the time? I've quickly gone through other issues on here and saw the mention of configuration options, but I don't see them anywhere.
Using Ubuntu 16.04, Gnome 3.20, and the newest version of this extension available here.

Thanks

Right click on close button shouldn't close window

Bug: Right-clicking on the close button in the activity bar closes the window. At the very least, it should do nothing.

Enhancement: Instead of doing nothing when the activity bars close button gets rightclicked, the same menu that gets shown when the "normal" close button (in the window title bar) gets rightclicked could be shown.

(Gnome offers the following actions by default for maximized windows: Minimize, Unmaximize, Move, Resize (disabled), Always on top (disabled), Always on Visible Workspace, Move to Workspace Up, Move to Workspace Down).

Option to only function on the primary display

Currently this applies to all displays, or no displays. I would appreciate an option to only have this happen on the user's primary display. I'm not familiar with gnome extensions so apologies if there are any technical hurdles in the way of this.

Disabling Pixel Saver does not restore orginal title bar state

Steps to reproduce:

  • Disable Pixel Saver
  • Start new application that is currently not running (I used Meld 3.12.1)
  • Maximize window of new application
  • Enable Pixel Saver
    -> the title bar of the new application should be hidden - works fine
  • Disable Pixel Saver
    -> the title bar of the new application should be visible, but it stays hidden!

The problem seems to be that if no maximized state can be found, this information is not cached and therefore the next invocation does not return the (cached) original state, but instead determines the state again. But if the maximized state has been set by Pixel Saver, it is stored and returned which means that the original state cannot be restored upon deactivation.

Not a big deal, but still warrants a fix.

hidetopbar Compatibility

When this extension is used in combination with hidetopbar, tabbed windows may cause the whole interface to be unreactive to any mouse action. More details can be found in issue mlutfy/hidetopbar#88.

feature request: undecorate all windows, not just maximized

It would be great to have an option to remove window decorations even for unmaximized windows. I previously achieved this through the metacity configuration, but this approach is not applicable in recent versions of gnome-shell that use gtk.css.

Unmaximize button, buttons shown only when active window is maximized

Love this extension - almost perfect for me, works better on my machine than Maximus ( which often left a black bar where title bar should be on my Fedora 21 /Gnome 3.14 install).
There are basically 2 minor issues I have:
1 Is it possible to get unmaximize button in Pixel Saver? I can cope by using keyboard shortcuts , but it would come really handy to have it.

2 When I toggle the apps, the buttons for the maximized one does not always disapear. And going the other way - the do not always apear when I toggle from other app to a maxmized one.
In this second instance when I click the top bar Pixel Saver buttons show up.

Are any workarounds for those? With those resolved Pixel Saver would be simply perfect :).

Close button always shown when fullscreen window is present

When a window is maximized in the current workspace*, the "close" button (and possibly other buttons as well, not tested) shows up in the titlebar, even if the active window is another one.

For example, in the screenshot below, the active window is an unmaximized terminal instance, but a close button is still shown, because the firefox browser on the same workspace is maximized. If the browser is unmaximized, the close button disappears.

Even more "disturbing": if I press the "close" button, the title quickly changes to the Firefox one, and Firefox is closed, instead of the terminal.

screenshot from 2015-12-17 10-09-04

I see this on GNOME Shell 3.18.1 on Debian testing with version 10 of this extension. It happens with or without a secondary screen attached.

Note that this also happens if a maximized window is present on a secondary screen when workspaces are only enabled on the primary screen

right click and property dialog

Hi!
Using latest version with Gnome 3.14 when i right click something like a folder in Nautilus or to get the menu in Firefox to display the source code i always get a cross to replace my cursor, then i have to right click again to get the property dialog or the source code. Also the window that opens sometimes doesn't display nice.
Tell me how can i give you a log to work on this issue.

Tag or Branch

Hello,

It would be awesome to have a tag or a dedicated branch for old versions of gnome.

Currently I'm using Gnome 3.10 and to make this extension work perfectly I should checkout the commit 4fb6409

Anyways, good job, I love your extension ;)

Show title on activity bar for Stacked Windows

When window is maximized, title is shown on Activy bar, but when it's stacked left|right the App name is shown:

screenshot from 2015-06-22 03 47 21
screenshot from 2015-06-22 03 47 34
screenshot from 2015-06-22 03 47 40

The better is to rewrite Activity Titke also when stacked, since the title bar is hidden.

Error: No signal 'maximize' on object 'ShellWM'

Using pixel-saver in Gnome 3.18, while it seems to works gnome-tweak-tool shows that the extension didn't load correctly. Using LookingGlass to investigate this issue returns the error in the title.

Reuse StatusTitleBar app menu

Hello, I'm the author of the StatusTitleBar extension, both extensions serve a similar purpose, so I propose we reuse code instead of duplicating it.

The ideal solution would be to have some sort of package manager for gnome shell extensions, but that doesn't seem possible right now, so I'm thinking on 2 possible solutions:

  1. I can continue to develop the status titlebar app menu only, and you can continue developing decorations.

  2. We merge our work and keep a single project with similar funcionality.

This is only a proposition, checkout the StatusTitleBar repository (https://github.com/emerinohdz/StatusTitleBar), I have integrated Gulp task manager and also the extension is developed in a more OO way.

Not working with Atom 1.5.3

Which is really weird, considering 1.3 used to work fine, and other apps also run fine.
Any ideas ?

Edit: I recompiled atom 1.3.2, just to make sure. It does work properly with 1.3.2, but not with 1.5+.

Allow choosing user not to integrate window controls to the top bar, hide them instead

I would like to please place a feature request to not integrate the buttons from the window decorations into the Gnome's top bar, while doing the wonderful stuff that PixelSaver currently does? :)

It looks somewhat out of place there and upsets my delicate balance of buttons on the top panes. Is there maybe a hack of some sort to do this in current version?

Title bar does not change when switching app windows

The title bar changes normally when switching windows between different apps, but fails to do so when switching windows of the same app (for example multiple Terminal windows, switch using `alt+``).

I've replaced this line (#193) in app_menu.js:

focusCallbackID = Shell.WindowTracker.get_default().connect('notify::focus-app', onFocusChange);

with

focusCallbackID = global.display.connect('notify::focus-window', onFocusChange);

This seems to have fixed this issue but I'm not sure if it affects any other functionality or whether it's the best way to do it.

3.18 compatibility

Hey,

I know there's a ticket for gnome 3.16 compatibility, but 3.18 is out and it doesn't work either D;

Wayland support

First, I'd like to thank you, deadalnix. Since my previous solution with Status Title Bar and a metacity theme hack broke with 3.16, I've been on the lookout for something that actually worked, and this one does.

So, since this extension uses xprop, it only works on X windows. Since I use Wayland, GTK3 applications do not shed their titlebar when maximized. This is generally not dramatic because most of them have an action bar anyway, but Evolution still uses a simple title bar. It would be great if I could remove its titlebar as well.

Invalid cleanup of workspace event

In decoration.js the notify:n-workspaces'event is registered with global.screen, but cleanup is wrongly performed against global.window_manager.

appMenu._label.setText is not a function

gnome-session[1829]: (gnome-shell:7240): Gjs-WARNING **: JS ERROR: TypeError: appMenu._label.setText is not a function
gnome-session[1829]: updateAppMenu@/home/andrew/.local/share/gnome-shell/extensions/[email protected]/app_menu.js:40

This breaks window titles
Wrapping it in a try/catch to silence the error and fixes titles, don't know enough about gnome-shell to debug myself

cursor change to crosshair,all window stuck

My desktop is running on debian 8, I clone the 1.5 release and checkout to 1.5, but every time a new window created, the cursor change to crosshair and all windows get stuck :(
but when I comment the 50th line( which is let act = win.get_compositor_private(); ) of decoration.js , the bug disappeared! I guess this function has some bugs, can you fix it?
Sorry about my chinglish :)

RFE: Restore 3.14 compatibility

I'm using Debian Stable and would appreciate if the extension would be compatible with this older release out-of-the-box. The breaking changes are fairly minimal and I would propose that instead of dropping the old code, some version checking conditions could be used instead to guard the code for the different releases.

There are already some places were a similar, but IMHO weaker, approach is taken, like

try {
    // Gnome 3.16
    wmCallbackIDs.push(global.window_manager.connect('maximize', updateVisibility));
    wmCallbackIDs.push(global.window_manager.connect('unmaximize', updateVisibility));
} catch (e) {
    // Gnome 3.18
    wmCallbackIDs.push(global.window_manager.connect('size-change', updateVisibility));
}

I would suggest to instead use something like

if (Version.since(3, 18)) {
    wmCallbackIDs.push(global.window_manager.connect('size-change', updateVisibility));
} else {
    wmCallbackIDs.push(global.window_manager.connect('maximize', updateVisibility));
    wmCallbackIDs.push(global.window_manager.connect('unmaximize', updateVisibility));
}

If you could agree with this proposal, I would be willing to create a PR with the necessary changes. Thanks.

feature request: buttons position & behaviour

I would like to configure where the buttons are displayed. I personally would prefer them after the system menu, not before it. I saw the code that sets the position of the buttons, and I think you could add a setting to let the user choose either an automatic position (as it is now), or a custom left or right aligned position.

Another thing is that they only show up when a window is maximized. If a non-maximized window is focused, they will perform an action on the maximized window, not on the focused window. This is a bit tricky, since the focused application name is displayed in the top bar, but the buttons act on the other window.

My suggestion is to keep the behaviour from the original window-buttons extension: always keep them visible (this will also prevent things moving all the time in the top bar) and tie them to the currently focused window. If there are no opened windows, they could be shown as disabled (or at least should do nothing).

tooltip

How about a tooltip with the full window title on mouseover on the the activity bar?
Could be usefull especially for web pages titles.

'appmenu' is not a valid button.

pixel-saver isn't working, and I see this message in syslog whenever I try to start the extension . Am on Ubuntu Gnome 15.10 beta.

Can I set which icons Pixel Saver will use?

Pixel Saver is such a saver ;) . But I encountered one issue - when I use Zukitwo theme and window decoration close/minize icons are being replaced by white dots (which ain't pretty). Is there a way to set "fixed" set of icons?

Nothing happens.

I tried installing like this:

git clone https://github.com/deadalnix/pixel-saver.git
cd pixel-saver
git checkout 1.6
cp -r [email protected] ~/.local/share/gnome-shell/extensions
gnome-shell-extension-tool -e [email protected]

When I maximize a window, the behavior is the same as before. Tried logging out and back in, but it still didn't work. I'm in Gnome 3.18.2. Does it need to be updated for the latest Gnome?

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.