This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from tty2/feature/i15-change-widget-position
Feature/i15 change widget position
- Loading branch information
Showing
6 changed files
with
107 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
##@ Test | ||
lint: ## Run linters only. | ||
@echo -e "\033[2m→ Run linters...\033[0m" | ||
|
||
test: ## Run go tests for files with tests. | ||
@echo -e "\033[2m→ Run tests for all files...\033[0m" | ||
|
||
check: lint test ## Run full check: lint and test. | ||
|
||
##@ Deploy | ||
zip: ## Make zip file for deploy to https://extensions.gnome.org/upload/. | ||
zip: compile-schemas ## Make zip file for deploy to https://extensions.gnome.org/upload/. | ||
@echo -e "\033[2m→ Making zip file...\033[0m" | ||
zip horizontal-workspace-indicatortty2.io.zip metadata.json extension.js stylesheet.css LICENSE | ||
zip horizontal-workspace-indicatortty2.io.zip metadata.json extension.js stylesheet.css prefs.js \ | ||
LICENSE \ | ||
schemas/gschemas.compiled \ | ||
schemas/org.gnome.shell.extensions.nothing-to-say.gschema.xml | ||
|
||
compile-schemas: ## Compile all in schemas folder | ||
glib-compile-schemas --strict schemas/ | ||
|
||
install: compile-schemas ## Copy to extensions directory for debug. | ||
cp -r * ~/.local/share/gnome-shell/extensions/[email protected] | ||
|
||
##@ Other | ||
#------------------------------------------------------------------------------ | ||
|
@@ -19,4 +19,4 @@ help: ## Display help | |
#------------- <https://suva.sh/posts/well-documented-makefiles> -------------- | ||
|
||
.DEFAULT_GOAL := help | ||
.PHONY: help lint test check build install run | ||
.PHONY: help zip compile-schemas install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"description": "Workspace indicator shows the amount of opened workspaces and the current one", | ||
"name": "Workspace indicator", | ||
"shell-version": ["3.38","40", "41"], | ||
"settings-schema": "org.gnome.shell.extensions.horizontal-workspace-indicator", | ||
"shell-version": ["40", "41"], | ||
"url": "https://github.com/tty2/horizontal-workspace-indicator", | ||
"uuid": "[email protected]", | ||
"version": "0.0.9" | ||
"version": "0.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
"use strict"; | ||
|
||
const Gio = imports.gi.Gio; | ||
const Gtk = imports.gi.Gtk; | ||
|
||
const ExtensionUtils = imports.misc.extensionUtils; | ||
const Extension = ExtensionUtils.getCurrentExtension(); | ||
|
||
function init() {} | ||
|
||
function buildPrefsWidget() { | ||
this.settings = ExtensionUtils.getSettings(); | ||
|
||
const prefsWidget = new Gtk.Grid({ | ||
margin_top: 20, | ||
margin_bottom: 20, | ||
margin_start: 20, | ||
margin_end: 20, | ||
column_spacing: 12, | ||
row_spacing: 12, | ||
visible: true, | ||
halign: Gtk.Align.CENTER, | ||
}); | ||
|
||
let title = new Gtk.Label({ | ||
label: `<b>Preferences</b>`, | ||
halign: Gtk.Align.CENTER, | ||
use_markup: true, | ||
visible: true | ||
}); | ||
prefsWidget.attach(title, 0, 0, 2, 1); | ||
|
||
let note = new Gtk.Label({ | ||
label: `After any changes turn the extension off and on again.`, | ||
halign: Gtk.Align.CENTER, | ||
use_markup: true, | ||
visible: true | ||
}); | ||
prefsWidget.attach(note, 0, 1, 2, 1); | ||
|
||
const widgetPositionLabel = new Gtk.Label({ | ||
label: "Widget position", | ||
halign: Gtk.Align.START, | ||
visible: true, | ||
}); | ||
prefsWidget.attach(widgetPositionLabel, 0, 2, 1, 1); | ||
|
||
const widgetPositionComboBox = new Gtk.ComboBoxText(); | ||
widgetPositionComboBox.append("right", "Right corner | Status area"); | ||
widgetPositionComboBox.append("center", "Center | Date time area"); | ||
widgetPositionComboBox.append("left", "Left corner | Activities area"); | ||
this.settings.bind( | ||
"widget-position", | ||
widgetPositionComboBox, | ||
"active-id", | ||
Gio.SettingsBindFlags.DEFAULT | ||
); | ||
prefsWidget.attach(widgetPositionComboBox, 1, 2, 1, 1); | ||
|
||
return prefsWidget; | ||
} |
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
schemas/org.gnome.shell.extensions.horizontal-workspace-indicator.gschema.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist> | ||
<schema id="org.gnome.shell.extensions.horizontal-workspace-indicator" path="/org/gnome/shell/extensions/horizontal-workspace-indicator/"> | ||
<key name="widget-position" type="s"> | ||
<choices> | ||
<choice value="right"/> | ||
<choice value="center"/> | ||
<choice value="left"/> | ||
</choices> | ||
<default>'right'</default> | ||
<summary>Widget position</summary> | ||
<description>This specifies the position of widget on the left, center or right of top panel.</description> | ||
</key> | ||
</schema> | ||
</schemalist> |