Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,6 @@ running Vagrant:

If you are running on a NTFS file system then you have to move out the key:
```
mv /path/to/gnome46/virtualbox/private_key $HOME/.ssh/vagrant_key
ln -sr $HOME/.ssh/vagrant_key /path/to/gnome46/virtualbox/private_key
mv /path/to/box/virtualbox/private_key $HOME/.ssh/vagrant_key
ln -sr $HOME/.ssh/vagrant_key /path/to/box/virtualbox/private_key
```
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ Vagrant.configure("2") do |config|
configure_gnome_vm(gnome46, "bento/fedora-40")
end

# GNOME 47 on Fedora 41
config.vm.define "gnome47", primary: true do |gnome46|
configure_gnome_vm(gnome46, "bento/fedora-41")
end

# GNOME 49 on Fedora 43
config.vm.define "gnome49" do |gnome49|
configure_gnome_vm(gnome49, "bento/fedora-43")
Expand Down
Binary file added accentColorBorder.webm
Binary file not shown.
6 changes: 2 additions & 4 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ function init(meta) {
`;

const prefsBanner = `// For GNOME Shell version before 45
const Config = imports.misc.config;

class ExtensionPreferences {
constructor(metadata) {
this.metadata = metadata;
Expand Down Expand Up @@ -86,8 +84,8 @@ function convertImports(text) {
// drop import of ExtensionPreferences class
text = text.replaceAll('import { ExtensionPreferences } from "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js";', "");

// drop import of Config from preferences
text = text.replaceAll('import * as Config from "resource:///org/gnome/Shell/Extensions/js/misc/config.js";', "");
// replace import of Config in preferences
text = text.replaceAll('import * as Config from "resource:///org/gnome/Shell/Extensions/js/misc/config.js";', "const Config = imports.misc.config;");

// replace import of translation related code
const regexTranslation = new RegExp(`import {(.*|\n.*)?gettext as _[^from]*[^;]*;`, 'gm');
Expand Down
66 changes: 66 additions & 0 deletions manage_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash

set -e # exit on error

# Usage info
usage() {
echo "Usage:"
echo " $0 fetch <PR_NUMBER> <PR_BRANCH_NAME>"
echo " $0 push <PR_USERNAME> <PR_BRANCH_NAME> [--force]"
echo
echo "Examples:"
echo " $0 fetch 345 feat-about-something"
echo " $0 push domferr feat-about-something"
echo " $0 push domferr feat-about-something --force"
exit 1
}

# Ensure at least one argument is provided
if [ $# -lt 1 ]; then
usage
fi

ACTION=$1
shift

case "$ACTION" in
fetch)
if [ $# -ne 2 ]; then
usage
fi
PR_NUMBER=$1
PR_BRANCH_NAME=$2

echo "Fetching PR #$PR_NUMBER into local branch '$PR_BRANCH_NAME'..."
set -x
git fetch origin pull/"$PR_NUMBER"/head:"$PR_BRANCH_NAME"
set +x
echo "✅ Done. You can now checkout the branch with:"
echo " git checkout $PR_BRANCH_NAME"
;;

push)
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
usage
fi
PR_USERNAME=$1
PR_BRANCH_NAME=$2
FORCE_FLAG=""

if [ "${3:-}" = "--force" ]; then
FORCE_FLAG="--force"
echo "⚠️ Force push enabled."
fi

echo "Pushing branch '$PR_BRANCH_NAME' to $PR_USERNAME/tilingshell.git as '$PR_BRANCH_NAME'..."
set -x
git push $FORCE_FLAG [email protected]:"$PR_USERNAME"/tilingshell.git "$PR_BRANCH_NAME":"$PR_BRANCH_NAME"
set +x
echo "✅ Done."
;;

*)
usage
;;
esac

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"build": "npm run clean && node esbuild.mjs && npm run build:schema",
"clean": "rm -rf dist; rm -rf dist_legacy",
"logs:follow": "journalctl --follow /usr/bin/gnome-shell",
"update-translations": "npm run create:translations && npm run merge:translations && npm run build:translations",
"build:schema": "npm run clean:schema && glib-compile-schemas ./resources/schemas --targetdir=./dist/schemas/ && cp ./dist/schemas/ ./dist_legacy/ -r",
"clean:schema": "rm -rf ./dist/schemas/*.compiled; rm -rf ./dist_legacy/schemas/*.compiled",
Expand All @@ -23,12 +24,12 @@
"prettier:check": "prettier --check \"**/*.{ts,scss}\"",
"prettier:fix": "prettier --write \"**/*.{ts,scss}\"",
"vm:sync": "vagrant rsync",
"dev:vm:gnome46": "npm run vm:sync; vagrant up gnome46",
"vm:destroy:gnome46": "vagrant destroy gnome46",
"vm:halt:gnome46": "vagrant halt gnome46",
"dev:vm:gnome49": "npm run vm:sync; vagrant up gnome49",
"vm:destroy:gnome49": "vagrant destroy gnome49",
"vm:halt:gnome49": "vagrant halt gnome49"
"vm:destroy": "vagrant destroy",
"vm:halt": "vagrant halt",
"dev:vm": "npm run vm:sync; vagrant up",
"dev:vm:gnome46": "npm run vm:sync gnome46; vagrant up gnome46",
"dev:vm:gnome47": "npm run vm:sync gnome47; vagrant up gnome47",
"dev:vm:gnome49": "npm run vm:sync gnome49; vagrant up gnome49"
},
"devDependencies": {
"esbuild": "^0.25.10",
Expand Down
2 changes: 1 addition & 1 deletion resources/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"49"
],
"version": 99,
"version-name": "17.0",
"version-name": "17.1",
"url": "https://github.com/domferr/tilingshell",
"settings-schema": "org.gnome.shell.extensions.tilingshell",
"gettext-domain": "tilingshell",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
<summary>Focused window border color</summary>
<description>The color of the focused window's border.</description>
</key>
<key name="window-use-custom-border-color" type="b">
<default>false</default>
<summary>Use custom color</summary>
<description>Use the color defined here for the focused window's border.</description>
</key>
<key name="window-border-width" type="u">
<default>3</default>
<summary>Focused window border width</summary>
Expand Down
46 changes: 44 additions & 2 deletions src/components/windowBorderManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class WindowBorder extends St.Bin {
private readonly _signals: SignalHandling;

private _window: Meta.Window;
private _interfaceSettings: Gio.Settings;
private _windowMonitor: number;
private _bindings: GObject.Binding[];
private _enableScaling: boolean;
Expand All @@ -45,6 +46,9 @@ class WindowBorder extends St.Bin {
this._bindings = [];
this._borderWidth = 1;
this._window = win;
this._interfaceSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.interface',
});
this._windowMonitor = win.get_monitor();
this._enableScaling = enableScaling;
this._delayedSmartBorderRadius = false;
Expand Down Expand Up @@ -321,6 +325,30 @@ class WindowBorder extends St.Bin {
cached_radius;
}

private _getGnomeAccentColor(): string {
// get the system's accent color, fallback to user's custom color
try {
const accentColorName =
this._interfaceSettings.get_string('accent-color');
debug('accentColorName', accentColorName);
return accentColorName;
const gnomeAccentColorMapping: Record<string, string> = {
blue: '#3584e4',
teal: '#2190a4',
green: '#3a944a',
yellow: '#c88800',
orange: '#ed5b00',
red: '#e62d42',
pink: '#d56199',
purple: '#9141ac',
slate: '#6f8396',
};
return gnomeAccentColorMapping[accentColorName];
} catch (_unused) {
return '#000000';
}
}

public updateStyle(): void {
// handle scale factor of the monitor
const monitorScalingFactor = this._enableScaling
Expand All @@ -335,6 +363,9 @@ class WindowBorder extends St.Bin {
(alreadyScaled ? 1 : scalingFactor) *
(Settings.WINDOW_BORDER_WIDTH /
(alreadyScaled ? scalingFactor : 1));
const borderColor = Settings.WINDOW_USE_CUSTOM_BORDER_COLOR
? Settings.WINDOW_BORDER_COLOR
: '-st-accent-color';
const radius = this._borderRadiusValue.map((val) => {
const valWithBorder = val === 0 ? val : val + borderWidth;
return (
Expand All @@ -347,7 +378,7 @@ class WindowBorder extends St.Bin {
? `${getScalingFactorSupportString(monitorScalingFactor)};`
: '';
this.set_style(
`border-color: ${Settings.WINDOW_BORDER_COLOR}; border-width: ${borderWidth}px; border-radius: ${radius[St.Corner.TOPLEFT]}px ${radius[St.Corner.TOPRIGHT]}px ${radius[St.Corner.BOTTOMRIGHT]}px ${radius[St.Corner.BOTTOMLEFT]}px; ${scalingFactorSupportString}`,
`border-color: ${borderColor}; border-width: ${borderWidth}px; border-radius: ${radius[St.Corner.TOPLEFT]}px ${radius[St.Corner.TOPRIGHT]}px ${radius[St.Corner.BOTTOMRIGHT]}px ${radius[St.Corner.BOTTOMLEFT]}px; ${scalingFactorSupportString}`,
);

if (this._borderWidth !== borderWidth) {
Expand Down Expand Up @@ -384,11 +415,15 @@ export class WindowBorderManager {

private _border: WindowBorder | null;
private _enableScaling: boolean;
private _interfaceSettings: Gio.Settings;

constructor(enableScaling: boolean) {
this._signals = new SignalHandling();
this._border = null;
this._enableScaling = enableScaling;
this._interfaceSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.interface',
});
}

public enable(): void {
Expand All @@ -415,7 +450,14 @@ export class WindowBorderManager {
this._signals.connect(Settings, Settings.KEY_WINDOW_BORDER_COLOR, () =>
this._border?.updateStyle(),
);

this._signals.connect(
Settings,
Settings.KEY_WINDOW_USE_CUSTOM_BORDER_COLOR,
() => this._border?.updateStyle(),
);
this._interfaceSettings.connect('changed::accent-color', () =>
this._border?.updateStyle(),
);
this._signals.connect(Settings, Settings.KEY_WINDOW_BORDER_WIDTH, () =>
this._border?.updateStyle(),
);
Expand Down
15 changes: 15 additions & 0 deletions src/components/windowsSuggestions/suggestionsTilePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import TilePreview from '../tilepreview/tilePreview';
import { buildBlurEffect, widgetOrientation } from '@utils/gnomesupport';
import Tile from '@components/layout/Tile';
import MasonryLayoutManager from './masonryLayoutManager';
import TouchEventHelper from '@utils/touch';

const MASONRY_LAYOUT_SPACING = 32;
const SCROLLBARS_SHOW_ANIM_DURATION = 100; // ms
Expand All @@ -26,6 +27,7 @@ export default class SuggestionsTilePreview extends TilePreview {
private _blur: boolean;
private _container: St.BoxLayout;
private _scrollView: St.ScrollView;
private _touchHelper: TouchEventHelper;

constructor(params: {
parent: Clutter.Actor;
Expand Down Expand Up @@ -94,6 +96,8 @@ export default class SuggestionsTilePreview extends TilePreview {
// @ts-expect-error "get_vscroll_bar is valid for GNOME < 48"
this._scrollView.get_vscroll_bar().opacity = 0;
}

this._touchHelper = new TouchEventHelper();
}

set blur(value: boolean) {
Expand Down Expand Up @@ -127,6 +131,8 @@ export default class SuggestionsTilePreview extends TilePreview {
this.add_effect(effect);

this.add_style_class_name('selection-tile-preview');

this._setupTouchScrolling();
}

_recolor() {
Expand Down Expand Up @@ -243,4 +249,13 @@ export default class SuggestionsTilePreview extends TilePreview {
public removeAllWindows() {
this._container.destroy_all_children();
}

private _setupTouchScrolling() {
this.connect('touch-event', (_, event: Clutter.Event) => {
return this._touchHelper.convertPanToScroll(
event,
this._scrollView,
);
});
}
}
Loading