Skip to content

Commit

Permalink
[desktop-scroller@ccadeptic23] V2.2 Add Desktop Cube & Flipper support (
Browse files Browse the repository at this point in the history
#799)

* Add the ability to use the Desktop Cube or Flipper extension to animate the workspace switch
  • Loading branch information
klangman authored Dec 22, 2024
1 parent 4230454 commit 4ee6f7d
Show file tree
Hide file tree
Showing 18 changed files with 245 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Known issues

Changelog
=========
Version 2.2
------------
Added ability to use the DesktopCube or Flipper extensions to animate the workspace switch
Version 2.1
------------
Added fix for cinnamon 2.6 removing some api's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Settings = imports.ui.settings;
const St = imports.gi.St;
const Tweener = imports.ui.tweener;
const Config = imports.misc.config
const ExtensionSystem = imports.ui.extensionSystem;

let desktopscroller = null;

Expand All @@ -42,6 +43,7 @@ DesktopScroller.prototype = {
this.settings.bindProperty(Settings.BindingDirection.IN, "showDirectionArrow", "showDirectionArrow", this.onSettingsChanged, null);
this.settings.bindProperty(Settings.BindingDirection.IN, "activationAreaWidth", "activationAreaWidth", this.onSettingsChanged, null);
this.settings.bindProperty(Settings.BindingDirection.IN, "showActivationAreas", "showActivationAreas", this.onSettingsChanged, null);
this.settings.bindProperty(Settings.BindingDirection.IN, "useSwitcherExtension", "useSwitcherExtension", this.onSettingsChanged, null);
this.onSettingsChanged();
},

Expand Down Expand Up @@ -77,6 +79,7 @@ DesktopScroller.prototype = {

onSettingsChanged: function()
{
this.workspaceSwitcherExt = null;
this.updateSettings();
},

Expand Down Expand Up @@ -113,7 +116,24 @@ DesktopScroller.prototype = {
var direction = scrollDirection == 1 ? Meta.MotionDirection.RIGHT : Meta.MotionDirection.LEFT;
this.switch_workspace(direction);
},


_updateWorkspaceSwitcherExt: function() {
// Check if one of the workspace switcher extensions are installed or if the state has changed since we last checked
if (ExtensionSystem.runningExtensions.indexOf('DesktopCube@yare') > -1 ) {
if (!this.workspaceSwitcherExt || this.workspaceSwitcherExt !== ExtensionSystem.extensions['DesktopCube@yare']['5.4']['extension']) {
this.workspaceSwitcherExt = ExtensionSystem.extensions['DesktopCube@yare']['5.4']['extension'];
}
} else if (ExtensionSystem.runningExtensions.indexOf('Flipper@connerdev') > -1) {
if (!this.workspaceSwitcherExt || this.workspaceSwitcherExt !== ExtensionSystem.extensions['Flipper@connerdev']['5.4']['extension']) {
this.workspaceSwitcherExt = ExtensionSystem.extensions['Flipper@connerdev']['5.4']['extension'];
}
}
// Make sure the switcher extension has the required API to allow us to change to any arbitrary workspace
if (this.workspaceSwitcherExt && typeof this.workspaceSwitcherExt.ExtSwitchToWorkspace !== "function") {
this.workspaceSwitcherExt = null;
}
},

switch_workspace: function(direction)
{
let active = global.screen.get_active_workspace();
Expand All @@ -123,8 +143,15 @@ DesktopScroller.prototype = {
{
if(this.showDirectionArrow){
this.showDirection(direction);
}
neighbor.activate(global.get_current_time());
}
if (this.useSwitcherExtension) {
this._updateWorkspaceSwitcherExt()
}
if (this.workspaceSwitcherExt) {
this.workspaceSwitcherExt.ExtSwitchToWorkspace(neighbor);
} else {
neighbor.activate(global.get_current_time());
}
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"3.6"
],
"uuid": "desktop-scroller@ccadeptic23",
"version": 2.1,
"version": 2.2,
"url": "http://cinnamon-spices.linuxmint.com/extensions",
"switchPrevIcon": "my-go-prev.svg",
"switchNextIcon": "my-go-next.svg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# This file is put in the public domain.
# Odyssey <[email protected]>, 2024.
#
Expand All @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2024-07-25 17:30+0200\n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -59,5 +59,16 @@ msgstr "Mostrar àrees d'activació"
msgid ""
"Check this to show the areas over which scrolling will switch the desktop."
msgstr ""
"Marqueu aquesta opció per mostrar les àrees sobre les quals el "
"desplaçament provocarà el canvi d'escriptori."
"Marqueu aquesta opció per mostrar les àrees sobre les quals el desplaçament "
"provocarà el canvi d'escriptori."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2017-06-11 19:27+0200\n"
"Last-Translator: Alan Mortensen <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -59,3 +59,14 @@ msgid ""
msgstr ""
"Aktivér denne for at vise områderne, hvor rulning vil skifte mellem "
"arbejdsområder."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2021-03-02 20:43+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -61,3 +61,14 @@ msgid ""
msgstr ""
"Aktivieren, um die Bereiche anzuzeigen, über die beim Scrollen die "
"Arbeitsfläche gewechselt wird."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
"Project-Id-Version: desktop-scroller@ccadeptic23 2.2\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -54,3 +54,14 @@ msgstr ""
msgid ""
"Check this to show the areas over which scrolling will switch the desktop."
msgstr ""

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

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

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-03-02 19:29+0000\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2024-05-30 9:50+1\n"
"Last-Translator: Muxutruk <[email protected]>\n"
"Language-Team: Basque <[email protected]>\n"
Expand Down Expand Up @@ -56,4 +57,16 @@ msgstr "Erakutsi aktibazio-eremuak"
msgid ""
"Check this to show the areas over which scrolling will switch the desktop."
msgstr ""
"Aukera hau ezarri, ikusteko zer eremutan korritu behar den idazmahaia aldatzeko."
"Aukera hau ezarri, ikusteko zer eremutan korritu behar den idazmahaia "
"aldatzeko."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: desktop-scroller@ccadeptic23 2.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2024-11-04 15:54+0200\n"
"Last-Translator: Kimmo Kujansuu <[email protected]>\n"
"Language-Team: \n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"Last-Translator: Kimmo Kujansuu <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: fi\n"

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

#. settings-schema.json->showDirectionArrow->description
msgid "Show direction arrow"
Expand Down Expand Up @@ -59,3 +59,14 @@ msgid ""
msgstr ""
"Valitse, jos haluat nähdä ohuen viivan, joiden alueella voit vierittää "
"työtiloja."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# DESKTOP SCROLLER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# ccadeptic23, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-06-24 22:42-0400\n"
"POT-Creation-Date: 2024-12-22 12:37-0500\n"
"PO-Revision-Date: 2021-04-11 19:57+0200\n"
"Last-Translator: Balazs Bosak <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -59,3 +59,14 @@ msgid ""
msgstr ""
"Jelölje be ezt, azon képernyőterületek megjelenítésére, amelyeken görgetve "
"válthat a munkaterületek között."

#. settings-schema.json->useSwitcherExtension->description
msgid "Use a workspace switcher extension if installed"
msgstr ""

#. settings-schema.json->useSwitcherExtension->tooltip
msgid ""
"Allow a Cinnamon extensions to animate the workspace change. This option has "
"no effect unless a compatible extension is installed. Requires Desktop Cube "
"2.0.2 or Flipper 2.0.0 and Cinnamon 5.4 or better."
msgstr ""
Loading

0 comments on commit 4ee6f7d

Please sign in to comment.