Turning Gnome 47 into a i3wm Clone

I will populate this post a bit more later. Especially if anyone else would like to try this Gnome 47+ tiling windows setup that features a clone of ALL my keyboard shortcuts from i3wm (launching apps, moving windows, switching workplaces and so on).

Here are some screenshots

With focus border (I don’t need/use it):

The wallpaper (please if anyone can find the original dragon image/logo I used years ago to create this wallpaper):

Reference

1 Like

wow, looks like a lot of work (and fun i guess)

1 Like

Not really. The install wizard takes less than 10mins. Mostly waiting on the ssd. Then to add and tweak the 4 extensions, and set all my i3 shortcuts key binds take about 15 mins.

However the time I spend not touching my mouse or trackpoint, sometimes for hours, just able to work completely from keyboard is really worth it.

Thanks for the explanation. I don’t use Gnome and thought it would be more work. Looks good in any case!

One thing I’ve been impressed with since switching to Gnome on my laptop is battery life. It was not bad before I got around 10 hours from 80% to 20%.

I used TLP before, you can see my tweaks here: ThinkPad T14s Gen 3 AMD Linux User Review + Tweaks

For Gnome, I noticed that it had built in power management modes but when unplugging the laptop it stayed in “balanced” and if you manually switched it to “Power saver” when you :electric_plug: back in, it didn’t switch back to “Balanced” (or Performance for that matter). It would stay in “Power Saver” which does a good job at throttling the CPU/cooling, annoying when you don’t need it.

I’m sure Gnome devs avoided this because of potential bugs or compatibility with different hardware. They are generally very conservative with introducing features. This also makes Gnome very stable.

I could not find a Gnome extension which could solve this, so I wrote a small script to detect the change from AC to unplugged/battery:

└─$ cat /usr/local/bin/power.sh

#!/bin/bash

# Initialize the last known state to prevent repeat actions.
LAST_LEVEL=""

dbus-monitor --system "type='signal',path='/org/freedesktop/UPower/devices/battery_BAT0',member='PropertiesChanged'" | while read LINE; do
    echo ${LINE} | grep battery_BAT0 | grep -q PropertiesChanged
    if [ $? -eq 0 ]; then
        BATT_STAT=$(dbus-send --print-reply=literal --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.DBus.Properties.Get string:org.freedesktop.UPower.Device string:State | awk '{ print $3; }')
        
        # Determine the desired power management mode
        if [ $BATT_STAT -eq 1 ] || [ $BATT_STAT -eq 4 ]; then
            LEVEL="balanced"  # Use balanced when on AC
        elif [ $BATT_STAT -eq 5 ]; then
            LEVEL="balanced"  # Use balanced for other states if needed
        else
            LEVEL="power-saver"  # Use power-saver when on battery
        fi
        
        # Apply changes only if the level has changed
        if [ "$LEVEL" != "$LAST_LEVEL" ]; then
            echo "Changing power level to ${LEVEL}"
            gdbus call --system --dest net.hadess.PowerProfiles --object-path /net/hadess/PowerProfiles --method org.freedesktop.DBus.Properties.Set 'net.hadess.PowerProfiles' 'ActiveProfile' "<'${LEVEL}'>" > /dev/null
            [[ $? -ne 0 ]] && echo "Could not change power level to ${LEVEL}!"
            LAST_LEVEL="$LEVEL"  # Update the last known state
        fi
    fi
done

So now when I unplug the laptop automatically goes into Power Saver mode, then reverts when plugged in:

The result, now I’m getting around 12 hours between that same range:

I still kept the tweak of charging to max of 80%. Also, it won’t charge unless below 50%, this helps reduce the amount of charging to non-charging back and forth. For example, if I’m at 55% and plugged in, it just remains at 55%. This can be manually bypassed with a command, but generally, I’m responsible with charging so when I have something coming up I always charge to 80% the night before.

Also see:

12 hours are quite impressing! it seems like the optimization possibilities with linux are endless

1 Like

It is a bit slow eh. I think the only laptops that can operate at full processing power and last 10+ hours are MacBooks. But I’ve never liked things handed to me. :sweat_smile:

1 Like