Skip to content

Commit 4ee6f7d

Browse files
authored
[desktop-scroller@ccadeptic23] V2.2 Add Desktop Cube & Flipper support (#799)
* Add the ability to use the Desktop Cube or Flipper extension to animate the workspace switch
1 parent 4230454 commit 4ee6f7d

File tree

18 files changed

+245
-52
lines changed

18 files changed

+245
-52
lines changed

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/README

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Known issues
2424

2525
Changelog
2626
=========
27+
Version 2.2
28+
------------
29+
Added ability to use the DesktopCube or Flipper extensions to animate the workspace switch
2730
Version 2.1
2831
------------
2932
Added fix for cinnamon 2.6 removing some api's

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/extension.js

+30-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const Settings = imports.ui.settings;
1616
const St = imports.gi.St;
1717
const Tweener = imports.ui.tweener;
1818
const Config = imports.misc.config
19+
const ExtensionSystem = imports.ui.extensionSystem;
1920

2021
let desktopscroller = null;
2122

@@ -42,6 +43,7 @@ DesktopScroller.prototype = {
4243
this.settings.bindProperty(Settings.BindingDirection.IN, "showDirectionArrow", "showDirectionArrow", this.onSettingsChanged, null);
4344
this.settings.bindProperty(Settings.BindingDirection.IN, "activationAreaWidth", "activationAreaWidth", this.onSettingsChanged, null);
4445
this.settings.bindProperty(Settings.BindingDirection.IN, "showActivationAreas", "showActivationAreas", this.onSettingsChanged, null);
46+
this.settings.bindProperty(Settings.BindingDirection.IN, "useSwitcherExtension", "useSwitcherExtension", this.onSettingsChanged, null);
4547
this.onSettingsChanged();
4648
},
4749

@@ -77,6 +79,7 @@ DesktopScroller.prototype = {
7779

7880
onSettingsChanged: function()
7981
{
82+
this.workspaceSwitcherExt = null;
8083
this.updateSettings();
8184
},
8285

@@ -113,7 +116,24 @@ DesktopScroller.prototype = {
113116
var direction = scrollDirection == 1 ? Meta.MotionDirection.RIGHT : Meta.MotionDirection.LEFT;
114117
this.switch_workspace(direction);
115118
},
116-
119+
120+
_updateWorkspaceSwitcherExt: function() {
121+
// Check if one of the workspace switcher extensions are installed or if the state has changed since we last checked
122+
if (ExtensionSystem.runningExtensions.indexOf('DesktopCube@yare') > -1 ) {
123+
if (!this.workspaceSwitcherExt || this.workspaceSwitcherExt !== ExtensionSystem.extensions['DesktopCube@yare']['5.4']['extension']) {
124+
this.workspaceSwitcherExt = ExtensionSystem.extensions['DesktopCube@yare']['5.4']['extension'];
125+
}
126+
} else if (ExtensionSystem.runningExtensions.indexOf('Flipper@connerdev') > -1) {
127+
if (!this.workspaceSwitcherExt || this.workspaceSwitcherExt !== ExtensionSystem.extensions['Flipper@connerdev']['5.4']['extension']) {
128+
this.workspaceSwitcherExt = ExtensionSystem.extensions['Flipper@connerdev']['5.4']['extension'];
129+
}
130+
}
131+
// Make sure the switcher extension has the required API to allow us to change to any arbitrary workspace
132+
if (this.workspaceSwitcherExt && typeof this.workspaceSwitcherExt.ExtSwitchToWorkspace !== "function") {
133+
this.workspaceSwitcherExt = null;
134+
}
135+
},
136+
117137
switch_workspace: function(direction)
118138
{
119139
let active = global.screen.get_active_workspace();
@@ -123,8 +143,15 @@ DesktopScroller.prototype = {
123143
{
124144
if(this.showDirectionArrow){
125145
this.showDirection(direction);
126-
}
127-
neighbor.activate(global.get_current_time());
146+
}
147+
if (this.useSwitcherExtension) {
148+
this._updateWorkspaceSwitcherExt()
149+
}
150+
if (this.workspaceSwitcherExt) {
151+
this.workspaceSwitcherExt.ExtSwitchToWorkspace(neighbor);
152+
} else {
153+
neighbor.activate(global.get_current_time());
154+
}
128155
}
129156
},
130157

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"3.6"
2121
],
2222
"uuid": "desktop-scroller@ccadeptic23",
23-
"version": 2.1,
23+
"version": 2.2,
2424
"url": "http://cinnamon-spices.linuxmint.com/extensions",
2525
"switchPrevIcon": "my-go-prev.svg",
2626
"switchNextIcon": "my-go-next.svg"

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/ca.po

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# This file is put in the public domain.
33
# Odyssey <odysseyhyd@gmail.com>, 2024.
44
#
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1212
"PO-Revision-Date: 2024-07-25 17:30+0200\n"
1313
"Last-Translator: Odyssey <odysseyhyd@gmail.com>\n"
1414
"Language-Team: \n"
@@ -59,5 +59,16 @@ msgstr "Mostrar àrees d'activació"
5959
msgid ""
6060
"Check this to show the areas over which scrolling will switch the desktop."
6161
msgstr ""
62-
"Marqueu aquesta opció per mostrar les àrees sobre les quals el "
63-
"desplaçament provocarà el canvi d'escriptori."
62+
"Marqueu aquesta opció per mostrar les àrees sobre les quals el desplaçament "
63+
"provocarà el canvi d'escriptori."
64+
65+
#. settings-schema.json->useSwitcherExtension->description
66+
msgid "Use a workspace switcher extension if installed"
67+
msgstr ""
68+
69+
#. settings-schema.json->useSwitcherExtension->tooltip
70+
msgid ""
71+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
72+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
73+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
74+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/da.po

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# ccadeptic23, 2017
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1212
"PO-Revision-Date: 2017-06-11 19:27+0200\n"
1313
"Last-Translator: Alan Mortensen <alanmortensen.am@gmail.com>\n"
1414
"Language-Team: \n"
@@ -59,3 +59,14 @@ msgid ""
5959
msgstr ""
6060
"Aktivér denne for at vise områderne, hvor rulning vil skifte mellem "
6161
"arbejdsområder."
62+
63+
#. settings-schema.json->useSwitcherExtension->description
64+
msgid "Use a workspace switcher extension if installed"
65+
msgstr ""
66+
67+
#. settings-schema.json->useSwitcherExtension->tooltip
68+
msgid ""
69+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
70+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
71+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
72+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/de.po

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# ccadeptic23, 2017
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1212
"PO-Revision-Date: 2021-03-02 20:43+0100\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -61,3 +61,14 @@ msgid ""
6161
msgstr ""
6262
"Aktivieren, um die Bereiche anzuzeigen, über die beim Scrollen die "
6363
"Arbeitsfläche gewechselt wird."
64+
65+
#. settings-schema.json->useSwitcherExtension->description
66+
msgid "Use a workspace switcher extension if installed"
67+
msgstr ""
68+
69+
#. settings-schema.json->useSwitcherExtension->tooltip
70+
msgid ""
71+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
72+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
73+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
74+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/desktop-scroller@ccadeptic23.pot

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# ccadeptic23, 2017
44
#
55
#, fuzzy
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
8+
"Project-Id-Version: desktop-scroller@ccadeptic23 2.2\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14-
"Language-Team: LANGUAGE <LL@li.org>\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
12+
"PO-Revision-Date: \n"
13+
"Last-Translator: \n"
14+
"Language-Team: \n"
1515
"Language: \n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
@@ -54,3 +54,14 @@ msgstr ""
5454
msgid ""
5555
"Check this to show the areas over which scrolling will switch the desktop."
5656
msgstr ""
57+
58+
#. settings-schema.json->useSwitcherExtension->description
59+
msgid "Use a workspace switcher extension if installed"
60+
msgstr ""
61+
62+
#. settings-schema.json->useSwitcherExtension->tooltip
63+
msgid ""
64+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
65+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
66+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
67+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/es.po

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# ccadeptic23, 2017
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1212
"PO-Revision-Date: 2023-11-03 11:49-0300\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -61,3 +61,14 @@ msgid ""
6161
msgstr ""
6262
"Marque esta opción para mostrar las áreas sobre las que el desplazamiento "
6363
"cambiará el escritorio."
64+
65+
#. settings-schema.json->useSwitcherExtension->description
66+
msgid "Use a workspace switcher extension if installed"
67+
msgstr ""
68+
69+
#. settings-schema.json->useSwitcherExtension->tooltip
70+
msgid ""
71+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
72+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
73+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
74+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/eu.po

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# ccadeptic23, 2017
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: \n"
10-
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2021-03-02 19:29+0000\n"
10+
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
11+
"extensions/issues\n"
12+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1213
"PO-Revision-Date: 2024-05-30 9:50+1\n"
1314
"Last-Translator: Muxutruk <muxutruk2@users.noreply.github.com>\n"
1415
"Language-Team: Basque <muxutruk2@users.noreply.github.com>\n"
@@ -56,4 +57,16 @@ msgstr "Erakutsi aktibazio-eremuak"
5657
msgid ""
5758
"Check this to show the areas over which scrolling will switch the desktop."
5859
msgstr ""
59-
"Aukera hau ezarri, ikusteko zer eremutan korritu behar den idazmahaia aldatzeko."
60+
"Aukera hau ezarri, ikusteko zer eremutan korritu behar den idazmahaia "
61+
"aldatzeko."
62+
63+
#. settings-schema.json->useSwitcherExtension->description
64+
msgid "Use a workspace switcher extension if installed"
65+
msgstr ""
66+
67+
#. settings-schema.json->useSwitcherExtension->tooltip
68+
msgid ""
69+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
70+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
71+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
72+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/fi.po

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# ccadeptic23, 2017
44
#
55
msgid ""
66
msgstr ""
77
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
88
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
99
"extensions/issues\n"
10-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
10+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1111
"PO-Revision-Date: 2024-11-04 15:54+0200\n"
12+
"Last-Translator: Kimmo Kujansuu <mrkujansuu@gmail.com>\n"
1213
"Language-Team: \n"
14+
"Language: fi\n"
1315
"MIME-Version: 1.0\n"
1416
"Content-Type: text/plain; charset=UTF-8\n"
1517
"Content-Transfer-Encoding: 8bit\n"
1618
"X-Generator: Poedit 2.3\n"
17-
"Last-Translator: Kimmo Kujansuu <mrkujansuu@gmail.com>\n"
1819
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19-
"Language: fi\n"
2020

2121
#. metadata.json->name
2222
msgid "Desktop Scroller"
@@ -26,8 +26,8 @@ msgstr "Desktop Scroller"
2626
msgid ""
2727
"Switch between desktops by scrolling at left and right edges of the screen."
2828
msgstr ""
29-
"Vaihda työtilojen välillä vierittämällä hiiren rullaa näytön vasemmassa "
30-
"tai oikeassa reunassa."
29+
"Vaihda työtilojen välillä vierittämällä hiiren rullaa näytön vasemmassa tai "
30+
"oikeassa reunassa."
3131

3232
#. settings-schema.json->showDirectionArrow->description
3333
msgid "Show direction arrow"
@@ -59,3 +59,14 @@ msgid ""
5959
msgstr ""
6060
"Valitse, jos haluat nähdä ohuen viivan, joiden alueella voit vierittää "
6161
"työtiloja."
62+
63+
#. settings-schema.json->useSwitcherExtension->description
64+
msgid "Use a workspace switcher extension if installed"
65+
msgstr ""
66+
67+
#. settings-schema.json->useSwitcherExtension->tooltip
68+
msgid ""
69+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
70+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
71+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
72+
msgstr ""

desktop-scroller@ccadeptic23/files/desktop-scroller@ccadeptic23/po/hu.po

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# DESKTOP SCROLLER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# ccadeptic23, 2017
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
11+
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
1212
"PO-Revision-Date: 2021-04-11 19:57+0200\n"
1313
"Last-Translator: Balazs Bosak <bossbob88@gmail.com>\n"
1414
"Language-Team: \n"
@@ -59,3 +59,14 @@ msgid ""
5959
msgstr ""
6060
"Jelölje be ezt, azon képernyőterületek megjelenítésére, amelyeken görgetve "
6161
"válthat a munkaterületek között."
62+
63+
#. settings-schema.json->useSwitcherExtension->description
64+
msgid "Use a workspace switcher extension if installed"
65+
msgstr ""
66+
67+
#. settings-schema.json->useSwitcherExtension->tooltip
68+
msgid ""
69+
"Allow a Cinnamon extensions to animate the workspace change. This option has "
70+
"no effect unless a compatible extension is installed. Requires Desktop Cube "
71+
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
72+
msgstr ""

0 commit comments

Comments
 (0)