Skip to content

Commit

Permalink
FancyZones feat: introducing layouts and layout editor to select, add…
Browse files Browse the repository at this point in the history
…, remove and edit layouts
  • Loading branch information
domferr committed Jul 9, 2023
1 parent 7ced8a8 commit 17385eb
Show file tree
Hide file tree
Showing 40 changed files with 1,596 additions and 850 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: clean format run-debug help

run-debug:
GSETTINGS_SCHEMA_DIR=\$GSETTINGS_SCHEMA_DIR:~/.local/share/gnome-shell/extensions/gSnap@micahosborne/schemas/:~/.local/share/gnome-shell/extensions/caffeine@patapon.info/schemas/ \
flutter run -d linux

release:
flutter build linux --release

format:
dart format .

clean:
rm -rf pubspec.lock
flutter clean
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ _🚧 Get Microsoft's PowerToys utilities and much more to Linux world! This pro

Linux PowerToys brings a set of utilities to tune and streamline Linux experience for greater productivity.

| | Utilities |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Awake** | Keep the computer awake without having to manage its power & sleep settings. This behaviour can be helpful when running time-consuming tasks, ensuring that the computer does not go to sleep or turn off its screens. |
| **FancyZones** | Window management utility that organizes and snaps windows into efficient layouts to enhance workflow speed and quickly restore layouts. FancyZones allows you to define a set of zone positions to use as destinations for windows on the desktop. When dragging a window into a zone or using the associated shortcut key, the window is resized and repositioned to fit that zone. |
| **Run** | To be implemented... |
| **Rename** | To be implemented... |
| **Hosts File Editor** | To be implemented... |
| **Mouse utilities** | To be implemented... |
| **Quick Accent** | To be implemented... |
| **Text Extractor** | To be implemented... |
| **Image Resizer** | To be implemented... |
| **Color Picker** | To be implemented... |
| | Utilities |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Awake** | Keep the computer awake without having to manage its power & sleep settings. This behaviour can be helpful when running time-consuming tasks, ensuring that the computer does not go to sleep or turn off its screens. |
| **FancyZones** | Window management utility that organizes and snaps windows into efficient layouts to enhance workflow speed and quickly restore layouts. FancyZones allows you to define a set of zone positions to use as destinations for windows on the desktop. When dragging a window into a zone or using the associated shortcut key, the window is resized and repositioned to fit that zone. [Learn more...](./doc/FANCY_ZONES.md) |
| **Run** | To be implemented... |
| **Rename** | To be implemented... |
| **Hosts File Editor** | To be implemented... |
| **Mouse utilities** | To be implemented... |
| **Quick Accent** | To be implemented... |
| **Text Extractor** | To be implemented... |
| **Image Resizer** | To be implemented... |
| **Color Picker** | To be implemented... |
## Project Attribution: Inspiring the Creation of Linux PowerToys

**Linux PowerToys**, is an open-source initiative aimed at bringing the utilities of Microsoft PowerToys and more to the Linux world. However, it is important to note that this project is not affiliated with or endorsed by Microsoft in any way. It is not a porting effort but a complete reimplementation from scratch. The original Microsoft PowerToys does not support Linux, and therefore, a porting process is not feasible.
Expand Down
29 changes: 29 additions & 0 deletions doc/FANCY_ZONES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Linux PowerToys | Fancy Zones
Experience the power of FancyZones, an innovative window manager that enables advanced window layout customization. Effortlessly organize and snap windows into predefined zones to enhance productivity and streamline multitasking on your Linux desktop.

## Layout Builder
The Layout Builder is a powerful feature of Linux PowerToys that allows you to create, edit, and remove layouts with ease.
With this tool, you can customize your window arrangements and optimize your productivity.
Let's explore the three main functionalities of the Layout Builder: creation, editing, and deletion.

These are the commands to fine-tune your layouts and achieve the perfect window arrangement for your tasks:
- **Left-click**: Left-clicking on a zone allows you to split it horizontally into two zones.
- **Left-click + Shift**: Holding down the left mouse button and pressing Shift on a zone enables vertical splitting into two zones.
- **Right-click**: Right-clicking on a zone allows you to delete it.

### Creating a Layout
To create a layout, follow these simple steps:

![Creating a Layout](./fz1-new-layout.gif)

### Edit an existing layout
If you want to modify an existing layout, the Layout Builder makes it a breeze:

![Editing a Layout](./fz2-edit-layout.gif)

### Removing a Layout
If you no longer need a particular layout, you can easily remove it:

![Removing a Layout](./fz3-delete-layout.gif)

Note: you cannot remove the currently selected layout.
Binary file added doc/fz1-new-layout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/fz2-edit-layout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/fz3-delete-layout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 16 additions & 19 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'dart:developer' as developer;
Expand All @@ -7,18 +8,17 @@ import 'src/constants.dart';
import 'src/home.dart';

void main() {
Logger.root.level = Level.ALL; // defaults to Level.INFO
Logger.root.level =
kDebugMode ? Level.ALL : Level.INFO; // defaults to Level.INFO
Logger.root.onRecord.listen((record) {
developer.log(
'[${record.level.name}] ${record.message}',
developer.log('[${record.level.name}] ${record.message}',
time: record.time,
level: record.level.value,
error: record.error,
stackTrace: record.stackTrace,
zone: record.zone,
sequenceNumber: record.sequenceNumber,
name: record.loggerName
);
name: record.loggerName);
debugPrint('[${record.level.name}] ${record.time}: ${record.message}');
});

Expand Down Expand Up @@ -62,11 +62,11 @@ class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
var navigationRailTheme = Theme.of(context).navigationRailTheme.copyWith(
unselectedLabelTextStyle: Theme.of(context).textTheme.titleMedium,
selectedLabelTextStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold
)
);
unselectedLabelTextStyle: Theme.of(context).textTheme.titleMedium,
selectedLabelTextStyle: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(fontWeight: FontWeight.bold));

return MaterialApp(
debugShowCheckedModeBanner: false,
Expand All @@ -83,18 +83,15 @@ class _AppState extends State<App> {
useMaterial3: true,
brightness: Brightness.dark,
navigationRailTheme: navigationRailTheme.copyWith(
selectedLabelTextStyle: navigationRailTheme.selectedLabelTextStyle?.copyWith(
color: Colors.white
),
unselectedLabelTextStyle: navigationRailTheme.unselectedLabelTextStyle?.copyWith(
color: Colors.white70
),
selectedLabelTextStyle: navigationRailTheme.selectedLabelTextStyle
?.copyWith(color: Colors.white),
unselectedLabelTextStyle: navigationRailTheme.unselectedLabelTextStyle
?.copyWith(color: Colors.white70),
),
),
home: Home(
useLightMode: useLightMode,
handleBrightnessChange: handleBrightnessChange
),
useLightMode: useLightMode,
handleBrightnessChange: handleBrightnessChange),
);
}
}
64 changes: 0 additions & 64 deletions lib/src/backend_api/fancy_zones/fancy_zones_backend.dart

This file was deleted.

10 changes: 0 additions & 10 deletions lib/src/backend_api/fancy_zones/zone_group.dart

This file was deleted.

7 changes: 0 additions & 7 deletions lib/src/backend_api/fancy_zones/zone_props.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ class GnomeExtensionUtils {
path: DBusObjectPath("/org/gnome/Shell/Extensions"),
name: "InstallRemoteExtension",
interface: "org.gnome.Shell.Extensions",
values: [DBusString(uuid)]
);
values: [DBusString(uuid)]);
}

static Future<Future<ProcessResult>> enableDisableExtension(String extensionName, bool enabled) async {
static Future<ProcessResult> enableDisableExtension(
String extensionName, bool enabled) {
var shell = Shell();
return shell.run('gnome-extensions', arguments: [ enabled ? 'enable':'disable', extensionName]);
return shell.run('gnome-extensions',
arguments: [enabled ? 'enable' : 'disable', extensionName]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ abstract class AwakeBackend extends UtilityBackend {

/// Sets the "keep awake" status to the specified [newValue].
setKeepAwake(bool newValue);
}
}
Loading

0 comments on commit 17385eb

Please sign in to comment.