From 84fd74f203334ee9535476dc69d5e331c280bad1 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Thu, 5 Mar 2020 19:49:42 +0100 Subject: [PATCH 01/31] Use github files --- dist/rpm/_service | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/rpm/_service b/dist/rpm/_service index 0f8eb40..2bee48e 100644 --- a/dist/rpm/_service +++ b/dist/rpm/_service @@ -2,9 +2,14 @@ https://github.com/Ximi1970/systray-x.git git - develop - 0~git%cd.%h - enable + 0.2.0 + dist/rpm/systray-x.changes + dist/rpm/systray-x.spec + dist/deb/debian.changelog + dist/deb/debian.compat + dist/deb/debian.control + dist/deb/debian.rules + dist/deb/systray-x.dsc From 5c89617921423fc17f8760281c5f83714d835d8a Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Thu, 5 Mar 2020 22:39:11 +0100 Subject: [PATCH 02/31] Update --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/README.md b/README.md index b11cddf..bd6a208 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,82 @@ The add-on and system tray application can do: - to be implemented: start a new mail - to be implemented: open the last used account +## Binaries + +### openSuSE + +Add the repository with YaST: + +''' +Name: SysTray-X +URL: https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_XXX +''' + +#### Leap 15.1 + +```bash +sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Leap_15.1/ SysTray-X +``` + +#### Leap 15.2 + +```bash +sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Leap_15.2/ SysTray-X +``` + +#### Tumbleweed + +```bash +sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Tumbleweed/ SysTray-X +``` + +#### SLE 15 + +```bash +sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_SLE_15_SP1/ SysTray-X +``` + + +### xUbuntu + +#### 19.10 + +```bash +wget -q https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10/Release.key +sudo apt-key add Release.key +``` +Add with Muon -> Settings -> Configures Software Sources +In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: + +```deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./``` + +Or manually: + +```bash +sudo echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./" > /etc/apt/source.list.d/systray-x.list``` +sudo apt update +``` + +#### 18.04 LTS + + +```bash +wget -q https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04/Release.key +sudo apt-key add Release.key +``` +Add with Muon -> Settings -> Configures Software Sources +In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: + +```deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./``` + +Or manually: + +```bash +sudo echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./" > /etc/apt/source.list.d/systray-x.list``` +sudo apt update +``` + + ## Building ### Linux From d6e778db23daf56cbefe83c734283dcff4eade67 Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Thu, 5 Mar 2020 22:42:23 +0100 Subject: [PATCH 03/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd6a208..bba8f65 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ The add-on and system tray application can do: Add the repository with YaST: -''' +``` Name: SysTray-X URL: https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_XXX -''' +``` #### Leap 15.1 From 5c943a601ef153b975441abc7b66e98d96035015 Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Thu, 5 Mar 2020 22:52:56 +0100 Subject: [PATCH 04/31] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bba8f65..07b0819 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Add the repository with YaST: ``` Name: SysTray-X -URL: https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_XXX +URL: https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_ ``` #### Leap 15.1 From 269ee62910306e1053eb2fef3aaff99dad81c16e Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Thu, 5 Mar 2020 22:53:51 +0100 Subject: [PATCH 05/31] Update README.md --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 07b0819..aebaa70 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,6 @@ The add-on and system tray application can do: ## Binaries ### openSuSE - -Add the repository with YaST: - -``` -Name: SysTray-X -URL: https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_ -``` - #### Leap 15.1 ```bash From 01507e74b039f6b740083dbb71aba38792839050 Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Thu, 5 Mar 2020 23:04:44 +0100 Subject: [PATCH 06/31] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index aebaa70..5231f9e 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,14 @@ Clone the repository using TortoiseGit: ... +### Remarks + +Branches: + +master : Should be stable and working for all systems +develop : Working but maybe not for all systems +feature-xxx : Experimental + ## Contributers Luigi Baldoni \ : Initial setup of the OpenSuSE Build Service rpm package. From 1c7fcfb038ad77ea65dffe49964eaa09933d887d Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sat, 7 Mar 2020 20:56:27 +0100 Subject: [PATCH 07/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5231f9e..73c28dd 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: Or manually: ```bash -sudo echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./" > /etc/apt/source.list.d/systray-x.list``` +sudo bash -c "echo 'deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update ``` @@ -75,7 +75,7 @@ In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: Or manually: ```bash -sudo echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./" > /etc/apt/source.list.d/systray-x.list``` +sudo bash -c 'echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update ``` From d49aef81b43b85cfa89c5dbb730cf4e9fbc6996a Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sat, 7 Mar 2020 20:58:14 +0100 Subject: [PATCH 08/31] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 73c28dd..da281f8 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Or manually: ```bash sudo bash -c "echo 'deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update +sudo apt install systray-x ``` #### 18.04 LTS @@ -77,6 +78,7 @@ Or manually: ```bash sudo bash -c 'echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update +sudo apt install systray-x ``` From f86198992e311a5575c16bc846868cbf546c90e8 Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sat, 7 Mar 2020 21:07:33 +0100 Subject: [PATCH 09/31] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da281f8..9b36437 100644 --- a/README.md +++ b/README.md @@ -19,27 +19,30 @@ The add-on and system tray application can do: ```bash sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Leap_15.1/ SysTray-X +sudo zypper in systray-x ``` #### Leap 15.2 ```bash sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Leap_15.2/ SysTray-X +sudo zypper in systray-x ``` #### Tumbleweed ```bash sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_Tumbleweed/ SysTray-X +sudo zypper in systray-x ``` #### SLE 15 ```bash sudo zypper ar -f https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/openSUSE_SLE_15_SP1/ SysTray-X +sudo zypper in systray-x ``` - ### xUbuntu #### 19.10 From 77c69ecda9f056cf16747eee0119ab7918df60da Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sat, 7 Mar 2020 21:09:08 +0100 Subject: [PATCH 10/31] Update README.md --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/README.md b/README.md index 9b36437..caa054e 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,6 @@ sudo zypper in systray-x ```bash wget -q https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10/Release.key sudo apt-key add Release.key -``` -Add with Muon -> Settings -> Configures Software Sources -In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: - -```deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./``` - -Or manually: - -```bash sudo bash -c "echo 'deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_19.10 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update sudo apt install systray-x @@ -66,19 +57,9 @@ sudo apt install systray-x #### 18.04 LTS - ```bash wget -q https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04/Release.key sudo apt-key add Release.key -``` -Add with Muon -> Settings -> Configures Software Sources -In the Software Source dialog -> Tab "Other Software" -> "Add..." and fill in: - -```deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./``` - -Or manually: - -```bash sudo bash -c 'echo "deb https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons/xUbuntu_18.04 ./" > /etc/apt/source.list.d/systray-x.list'``` sudo apt update sudo apt install systray-x From baa4b7ec367208ae73ffcf5be6b5e4e55204b47e Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 13:44:37 +0100 Subject: [PATCH 11/31] Use id as XPI flle name --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3f44971..3495379 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,10 @@ clean: rm -rf app/build ;\ systray-x-xpi: - @echo "Creating systray-x.xpi" ;\ - rm -f systray-x.xpi ;\ + @echo "Creating systray-x@Ximi1970.xpi" ;\ + rm -f systray-x@Ximi1970.xpi ;\ cd webext ;\ - zip ../systray-x.xpi -qr * ;\ + zip ../systray-x@Ximi1970.xpi -qr * ;\ cd .. systray-x-app: From 7e5155242d27b7d4a455b92b4b07a65fae335a2a Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 18:19:45 +0100 Subject: [PATCH 12/31] Update name --- dist/deb/debian.control | 2 -- dist/deb/debian.rules | 2 +- dist/rpm/systray-x.spec | 11 +++++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dist/deb/debian.control b/dist/deb/debian.control index d9cc475..baba238 100644 --- a/dist/deb/debian.control +++ b/dist/deb/debian.control @@ -16,5 +16,3 @@ Description: SysTray-X is a system tray extension for Thunderbird 68+. * show / hide Thunderbird (minimize) * minimizing hides to tray * minimize on startup - * to be implemented: start a new mail - * to be implemented: open the last used account diff --git a/dist/deb/debian.rules b/dist/deb/debian.rules index 15c59d1..3bcbbe5 100644 --- a/dist/deb/debian.rules +++ b/dist/deb/debian.rules @@ -53,7 +53,7 @@ install: build cp -f SysTray_X.json /usr/src/packages/BUILD/debian/systray-x/usr/lib/mozilla/native-messaging-hosts/SysTray_X.json mkdir -p /usr/src/packages/BUILD/debian/systray-x/usr/lib/thunderbird-addons/extensions - cp -f systray-x.xpi /usr/src/packages/BUILD/debian/systray-x/usr/lib/thunderbird-addons/extensions/systray-x@Ximi1970.xpi + cp -f systray-x@Ximi1970.xpi /usr/src/packages/BUILD/debian/systray-x/usr/lib/thunderbird-addons/extensions/systray-x@Ximi1970.xpi # --- end custom part for installing # Build architecture-independent files here. diff --git a/dist/rpm/systray-x.spec b/dist/rpm/systray-x.spec index 0180774..11bb9ba 100644 --- a/dist/rpm/systray-x.spec +++ b/dist/rpm/systray-x.spec @@ -41,9 +41,8 @@ The add-on and system tray application can do: * custom new mail icon * display number of unread mails * show / hide Thunderbird (minimize) - * to be implemented: remove from task bar when minimized - * to be implemented: start a new mail - * to be implemented: open the last used account + * minimizing hides to tray + * minimize on startup %prep %autosetup -p1 @@ -55,11 +54,11 @@ make %{?_smp_mflags} _systx_dir=%{buildroot}%{_libdir}/mozilla/extensions/\{3550f703-e582-4d05-9a08-453d09bdfdc6\}/systray-x@Ximi1970 install -Dm0755 SysTray-X %{buildroot}/%{_bindir}/SysTray-X mkdir -pv $_systx_dir -unzip -d $_systx_dir systray-x.xpi +unzip -d $_systx_dir systray-x@Ximi1970.xpi %files -%license LICENSE -%doc README.md +%license LICENSE +%doc README.md systray-x@Ximi1970.xpi %{_bindir}/SysTray-X %{_libdir}/mozilla From e78cac30706ac97b3a995981beb53e3381250a08 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 18:20:34 +0100 Subject: [PATCH 13/31] Add platform info --- webext/background.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webext/background.js b/webext/background.js index 068ff88..a48e609 100644 --- a/webext/background.js +++ b/webext/background.js @@ -1,5 +1,7 @@ var SysTrayX = { - debugAccounts: false + debugAccounts: false, + + platformInfo: undefined }; SysTrayX.Messaging = { @@ -302,6 +304,14 @@ async function start() { }); } + // Set platform + SysTrayX.platformInfo = await browser.runtime + .getPlatformInfo() + .then(info => info); + console.log("OS: " + SysTrayX.platformInfo.os); + console.log("Arch: " + SysTrayX.platformInfo.arch); + console.log("Nack-Arch: " + SysTrayX.platformInfo.nacl_arch); + // Init defaults before everything await getDefaultIcon(); From 0588c539d0b70142aef7acfd1b50d9e4ca233bda Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 22:08:19 +0100 Subject: [PATCH 14/31] Add bash installer template --- dist/install.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 dist/install.sh diff --git a/dist/install.sh b/dist/install.sh new file mode 100755 index 0000000..9e1f4c5 --- /dev/null +++ b/dist/install.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +INSTALL_HOME=`echo ~` + +if [ "$1" == "-h" ] ; then + echo + echo "Usage: $0 [abs-install-path]" + echo + echo " Default install path: $INSTALL_HOME/.mozilla/native-messaging-hosts" + echo + exit 0 +fi + +if [ -n "$1" ] ; then + DESTINATION="$1" +else + DESTINATION="$INSTALL_HOME/.mozilla/native-messaging-hosts" +fi + +# +# Tell the user what we are going to do +# +echo +echo "Installing SysTray-X companion app to:" +echo "$DESTINATION" +echo +read -n 1 -s -r -p "Press any key to continue, Ctrl-C to cancel" +echo + +# +# Install +# +echo "Installing SysTray-X companion app..." + +# +# Create destination +# +mkdir -p ${DESTINATION} + +# +# Find __ARCHIVE__ maker, read archive content and decompress it +# +ARCHIVE=$(awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "${0}") +tail -n+${ARCHIVE} "${0}" | tar xpJ -C ${DESTINATION} + +# +# Set the config +# +INSTALL_HOME=`echo ~` +sed -i "s?SYSTRAY_X_PATH?${DESTINATION}/SysTray-X?" ${DESTINATION}/SysTray_X.json.template +mv -f ${DESTINATION}/SysTray_X.json.template ${DESTINATION}/SysTray_X.json + +# +# Done +# +echo "" +echo "Companian app installation complete." +echo "App en JSON config have been installed in: $DESTINATION" +echo "" +echo "Do not forget to install the Thunderbird SysTray-X Add-on" +echo "using the standard Thunderbird Add-ons / Extensions store !" +echo "" +exit 0 + +__ARCHIVE__ From ea47a93939b12da503f5892985dc40be92f4dde2 Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sun, 8 Mar 2020 22:42:31 +0100 Subject: [PATCH 15/31] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index caa054e..b5acdc2 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ The add-on and system tray application can do: - show / hide Thunderbird (minimize) - minimizing hides to tray - minimize on startup -- to be implemented: start a new mail -- to be implemented: open the last used account ## Binaries From 89d888eee1fec217c1557e9fd1d0e0a0ccc18b2f Mon Sep 17 00:00:00 2001 From: Maxime Rijnders Date: Sun, 8 Mar 2020 23:29:33 +0100 Subject: [PATCH 16/31] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b5acdc2..5cd7b4a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,10 @@ The add-on and system tray application can do: - minimizing hides to tray - minimize on startup -## Binaries +## Binaries (System) + +These packages will install the Thunderbird Add-on and companion app system wide. +Root credentials are required. ### openSuSE #### Leap 15.1 @@ -63,6 +66,16 @@ sudo apt update sudo apt install systray-x ``` +## Binaries (User) + +User installable package. +No root credentials required. + +Download the installer here: + +[Companion installer](https://github.com/Ximi1970/systray-x/releases) + +And install the add-on using the Thunderbird Add-on / Extensions store. ## Building From 55030dd8c279d1bdfb2fcbc8ac3b9d48e6fd2fcb Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 23:46:06 +0100 Subject: [PATCH 17/31] Force version number --- dist/rpm/_service | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/rpm/_service b/dist/rpm/_service index 2bee48e..d4d2a11 100644 --- a/dist/rpm/_service +++ b/dist/rpm/_service @@ -3,6 +3,7 @@ https://github.com/Ximi1970/systray-x.git git 0.2.0 + 0.2.0 dist/rpm/systray-x.changes dist/rpm/systray-x.spec dist/deb/debian.changelog From ba44f7531f6475fea6c99dbfa92835937f817fc7 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 8 Mar 2020 23:47:04 +0100 Subject: [PATCH 18/31] Add linux installer creator --- create_linux_installers.sh | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100755 create_linux_installers.sh diff --git a/create_linux_installers.sh b/create_linux_installers.sh new file mode 100755 index 0000000..200b3e5 --- /dev/null +++ b/create_linux_installers.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +VERSION="0" + +OBS_BASE="https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons:/Staging:/Test" +OBS_PACKAGE="systray-x" + +OBS_RPM_ARCHS="openSUSE_Leap_15.1/x86_64 " +OBS_RPM_ARCHS+="openSUSE_Tumbleweed/i586 " +OBS_RPM_ARCHS+="openSUSE_Tumbleweed/x86_64 " +OBS_RPM_ARCHS+="SLE_15_SP1/x86_64 " + +OBS_DEB_ARCHS="xUbuntu_18.04/i386 " +OBS_DEB_ARCHS+="xUbuntu_18.04/amd64 " +OBS_DEB_ARCHS+="xUbuntu_19.04/amd64 " +OBS_DEB_ARCHS+="xUbuntu_19.10/amd64 " + +pushd bin > /dev/null 2>&1 + +# +# Create bash installers for RPM based distributions +# +for rpmdir in $OBS_RPM_ARCHS ; do + # + # Get base name + # + BASE_NAME=${rpmdir//'/'/$'-'} + + PACKAGE_NAME=SysTray-X-$VERSION-$BASE_NAME + + rm -rf $PACKAGE_NAME + mkdir -p $PACKAGE_NAME + pushd $PACKAGE_NAME > /dev/null 2>&1 + + # + # Get index.html + # + wget -q "$OBS_BASE/$rpmdir/" + + # + # Find rpm + # + RPM_FILE=`grep ">systray.*<" index.html | sed -e "s/.*>\(systray-x.*rpm\)<.*/\1/"` + + # + # Get rpm + # + wget -q "$OBS_BASE/$rpmdir/$RPM_FILE" + + # + # Extract + # + rpm2cpio $RPM_FILE | cpio -i --to-stdout ./usr/bin/SysTray-X > SysTray-X 2>/dev/null + chmod 755 SysTray-X + + # + # Get JSON + # + cp -f ../../app/config/linux/SysTray_X.json.template SysTray_X.json.template + + # + # Cleanup + # + rm -f index.html + rm -f $RPM_FILE + + tar cJf ../$PACKAGE_NAME.tar.xz . + + popd > /dev/null 2>&1 + + # + # Create installer + # + cp -f ../dist/install.sh SysTray-X-$VERSION-$BASE_NAME-install.sh + cat $PACKAGE_NAME.tar.xz >> SysTray-X-$VERSION-$BASE_NAME-install.sh + chmod 755 SysTray-X-$VERSION-$BASE_NAME-install.sh + + # + # Cleanup + # + rm -rf $PACKAGE_NAME + rm -f $PACKAGE_NAME.tar.xz + +done + +popd > /dev/null 2>&1 From 056bb92037bf054f16b0599bf7a1c69d32e2a7f4 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Mon, 9 Mar 2020 21:34:27 +0100 Subject: [PATCH 19/31] Check for valid winId --- app/SysTray-X/windowctrl-unix.cpp | 20 ++++++++++++++++++++ app/SysTray-X/windowctrl-win.cpp | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/app/SysTray-X/windowctrl-unix.cpp b/app/SysTray-X/windowctrl-unix.cpp index 6b29914..f69545b 100644 --- a/app/SysTray-X/windowctrl-unix.cpp +++ b/app/SysTray-X/windowctrl-unix.cpp @@ -237,6 +237,11 @@ QList< quint64 > WindowCtrlUnix::getWinIds() */ void WindowCtrlUnix::minimizeWindow( quint64 window, bool hide ) { + if( !window ) + { + return; + } + Window win = static_cast( window ); if( hide ) @@ -254,6 +259,11 @@ void WindowCtrlUnix::minimizeWindow( quint64 window, bool hide ) */ void WindowCtrlUnix::normalizeWindow( quint64 window ) { + if( !window ) + { + return; + } + Window win = static_cast( window ); hideWindow( win, false ); @@ -278,6 +288,11 @@ void WindowCtrlUnix::normalizeWindow( quint64 window ) */ void WindowCtrlUnix::hideWindow( quint64 window, bool set ) { + if( !window ) + { + return; + } + Window win = static_cast( window ); char prop_name[] = "_NET_WM_STATE"; @@ -360,6 +375,11 @@ void WindowCtrlUnix::hideWindow( quint64 window, bool set ) */ void WindowCtrlUnix::deleteWindow( quint64 window ) { + if( !window ) + { + return; + } + Window win = static_cast( window ); Atom prop = XInternAtom( m_display, "WM_PROTOCOLS", True ); diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index fb6b2ff..f8cd18d 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -198,6 +198,11 @@ QList< quint64 > WindowCtrlWin::getWinIds() */ void WindowCtrlWin::minimizeWindow( quint64 window, bool hide ) { + if( !window ) + { + return; + } + ShowWindow( (HWND)window, SW_MINIMIZE ); if( hide ) @@ -212,6 +217,11 @@ void WindowCtrlWin::minimizeWindow( quint64 window, bool hide ) */ void WindowCtrlWin::normalizeWindow( quint64 window ) { + if( !window ) + { + return; + } + ShowWindow( (HWND)window, SW_RESTORE ); SetForegroundWindow( (HWND)window ); } @@ -222,6 +232,11 @@ void WindowCtrlWin::normalizeWindow( quint64 window ) */ void WindowCtrlWin::hideWindow( quint64 window, bool state ) { + if( !window ) + { + return; + } + if( state ) { hideWindow( (HWND)window ); @@ -249,6 +264,11 @@ void WindowCtrlWin::hideWindow( HWND hwnd ) */ void WindowCtrlWin::deleteWindow( quint64 window ) { + if( !window ) + { + return; + } + SendMessageA( (HWND)window, WM_CLOSE, 0, 0 ); } From 1082342359cdbde7a3db910c0bbb450e46a9725b Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Mon, 9 Mar 2020 22:48:45 +0100 Subject: [PATCH 20/31] WIP check parent process --- app/SysTray-X/windowctrl-win.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index f8cd18d..8e32c3d 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -5,7 +5,8 @@ /* * System includes */ -#include +#include +#include #include /* @@ -64,6 +65,19 @@ qint64 WindowCtrlWin::getPpid() } +/* + * Get the process name + */ +QString WindowCtrl::getProcessName( qint64 pid ) +{ + HANDLE proc = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, getPpid() ); + char name[ 256 ]; + GetModuleBaseNameA( proc, NULL, name, 256); + + return QString( name ); +} + + /* * Find the window by title */ From 5b1a2d670af7c28c84cbd711d47fa277f31b1774 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Mon, 9 Mar 2020 23:23:02 +0100 Subject: [PATCH 21/31] Check parent executable name --- app/SysTray-X/windowctrl-win.cpp | 22 ++++++++++++++++------ app/SysTray-X/windowctrl-win.h | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index 8e32c3d..c6457ae 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -13,6 +13,7 @@ * Qt includes */ #include +#include /* * Statics @@ -65,12 +66,21 @@ qint64 WindowCtrlWin::getPpid() } +/* + * Is the pid from thunderbird + */ +bool WindowCtrlWin::isThunderbird( qint64 pid ) +{ + return getProcessName( pid ).contains( "thunderbird", Qt::CaseInsensitive ); +} + + /* * Get the process name */ -QString WindowCtrl::getProcessName( qint64 pid ) +QString WindowCtrlWin::getProcessName( qint64 pid ) { - HANDLE proc = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, getPpid() ); + HANDLE proc = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, pid ); char name[ 256 ]; GetModuleBaseNameA( proc, NULL, name, 256); @@ -212,7 +222,7 @@ QList< quint64 > WindowCtrlWin::getWinIds() */ void WindowCtrlWin::minimizeWindow( quint64 window, bool hide ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -231,7 +241,7 @@ void WindowCtrlWin::minimizeWindow( quint64 window, bool hide ) */ void WindowCtrlWin::normalizeWindow( quint64 window ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -246,7 +256,7 @@ void WindowCtrlWin::normalizeWindow( quint64 window ) */ void WindowCtrlWin::hideWindow( quint64 window, bool state ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -278,7 +288,7 @@ void WindowCtrlWin::hideWindow( HWND hwnd ) */ void WindowCtrlWin::deleteWindow( quint64 window ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } diff --git a/app/SysTray-X/windowctrl-win.h b/app/SysTray-X/windowctrl-win.h index 5d97264..bfd6010 100644 --- a/app/SysTray-X/windowctrl-win.h +++ b/app/SysTray-X/windowctrl-win.h @@ -45,6 +45,24 @@ class WindowCtrlWin : public QObject */ qint64 getPpid(); + /** + * @brief isThunderbird. Is this a thunderbird pid. + * + * @param pid The process Id to check. + * + * @return True if this is thunderbird. + */ + bool isThunderbird( qint64 pid ); + + /** + * @brief getProcessName. Get the name of the proces by pid. + * + * @param pid The process Id. + * + * @return The process name. + */ + QString getProcessName( qint64 pid ); + /** * @brief findWindow. Find window by title. * From caba40bd944b001121f82a92d2945e7ad877cf2b Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Mon, 9 Mar 2020 23:44:56 +0100 Subject: [PATCH 22/31] Only hide the dialog --- app/SysTray-X/preferencesdialog.cpp | 19 +++++++++++++++++-- app/SysTray-X/preferencesdialog.h | 21 +++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/app/SysTray-X/preferencesdialog.cpp b/app/SysTray-X/preferencesdialog.cpp index 1e37d84..62ded0f 100644 --- a/app/SysTray-X/preferencesdialog.cpp +++ b/app/SysTray-X/preferencesdialog.cpp @@ -46,6 +46,7 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi */ connect( m_ui->chooseCustomButton, &QPushButton::clicked, this, &PreferencesDialog::slotFileSelect ); connect( m_ui->buttonBox, &QDialogButtonBox::accepted, this, &PreferencesDialog::slotAccept ); + connect( m_ui->buttonBox, &QDialogButtonBox::rejected, this, &PreferencesDialog::slotReject ); } @@ -148,9 +149,23 @@ void PreferencesDialog::slotAccept() m_pref->setAppPrefChanged( false ); /* - * Tell the base + * Close it */ - QDialog::accept(); +// QDialog::accept(); + hide(); +} + + +/* + * Handle the accept signal + */ +void PreferencesDialog::slotReject() +{ + /* + * Close it + */ +// QDialog::reject(); + hide(); } diff --git a/app/SysTray-X/preferencesdialog.h b/app/SysTray-X/preferencesdialog.h index 1ab515b..e3be69d 100644 --- a/app/SysTray-X/preferencesdialog.h +++ b/app/SysTray-X/preferencesdialog.h @@ -87,46 +87,51 @@ class PreferencesDialog : public QDialog /** * @brief signalUpdateSysTray. Signal to update the system tray icon. */ - void signalUpdateSysTrayIcon(); + void signalUpdateSysTrayIcon(); public slots: /** * @brief slotDebugChange. Slot for handling debug change signals. */ - void slotDebugChange(); + void slotDebugChange(); /** * @brief slotHideOnMinimizeChange. Slot for handling hide on minimize change signals. */ - void slotHideOnMinimizeChange(); + void slotHideOnMinimizeChange(); /** * @brief slotStartMinimizedChange. Slot for handling start minimized change signals. */ - void slotStartMinimizedChange(); + void slotStartMinimizedChange(); /** * @brief slotIconTypeChange. Slot for handling icon type change signals. */ - void slotIconTypeChange(); + void slotIconTypeChange(); /** * @brief slotIconDataChange. Slot for handling icon data change signals. */ - void slotIconDataChange(); + void slotIconDataChange(); private slots: /** * @brief slotAccept. Store the preferences on the accept signal. */ - void slotAccept(); + void slotAccept(); + + /** + * @brief slotReject. Store the preferences on the accept signal. + */ + void slotReject(); /** * @brief slotFileSelect. Handle the choose custom button click. */ - void slotFileSelect(); + void slotFileSelect(); private: From 43a8cef1979eeecd49dec3c054df0d6d945df0e7 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Tue, 10 Mar 2020 00:17:23 +0100 Subject: [PATCH 23/31] Check parent executable name --- app/SysTray-X/windowctrl-unix.cpp | 29 +++++++++++++++++++++++++---- app/SysTray-X/windowctrl-unix.h | 19 +++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/app/SysTray-X/windowctrl-unix.cpp b/app/SysTray-X/windowctrl-unix.cpp index f69545b..314fabf 100644 --- a/app/SysTray-X/windowctrl-unix.cpp +++ b/app/SysTray-X/windowctrl-unix.cpp @@ -40,6 +40,27 @@ qint64 WindowCtrlUnix::getPpid() } +/* + * Is the pid from thunderbird + */ +bool WindowCtrlUnix::isThunderbird( qint64 pid ) +{ + return getProcessName( pid ).contains( "thunderbird", Qt::CaseInsensitive ); +} + + +/* + * Get the process name + */ +QString WindowCtrlUnix::getProcessName( qint64 pid ) +{ + QString process_name = QString( "/proc/%1/exe" ).arg( pid ); + QFileInfo process( process_name ); + + return process.canonicalFilePath(); +} + + /* * Find window(s) by title */ @@ -237,7 +258,7 @@ QList< quint64 > WindowCtrlUnix::getWinIds() */ void WindowCtrlUnix::minimizeWindow( quint64 window, bool hide ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -259,7 +280,7 @@ void WindowCtrlUnix::minimizeWindow( quint64 window, bool hide ) */ void WindowCtrlUnix::normalizeWindow( quint64 window ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -288,7 +309,7 @@ void WindowCtrlUnix::normalizeWindow( quint64 window ) */ void WindowCtrlUnix::hideWindow( quint64 window, bool set ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } @@ -375,7 +396,7 @@ void WindowCtrlUnix::hideWindow( quint64 window, bool set ) */ void WindowCtrlUnix::deleteWindow( quint64 window ) { - if( !window ) + if( !isThunderbird( getPpid() ) ) { return; } diff --git a/app/SysTray-X/windowctrl-unix.h b/app/SysTray-X/windowctrl-unix.h index bdcfdba..1db14a9 100644 --- a/app/SysTray-X/windowctrl-unix.h +++ b/app/SysTray-X/windowctrl-unix.h @@ -17,6 +17,7 @@ * Qt includes */ #include +#include /* * Predefines @@ -121,6 +122,24 @@ class WindowCtrlUnix : public QObject */ qint64 getPpid(); + /** + * @brief isThunderbird. Is this a thunderbird pid. + * + * @param pid The process Id to check. + * + * @return True if this is thunderbird. + */ + bool isThunderbird( qint64 pid ); + + /** + * @brief getProcessName. Get the name of the proces by pid. + * + * @param pid The process Id. + * + * @return The process name. + */ + QString getProcessName( qint64 pid ); + /** * @brief findWindow. Find window by (sub)title. * From a5b70aa582820e563a3b97021ee0d97b4e0d130d Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Tue, 10 Mar 2020 19:43:28 +0100 Subject: [PATCH 24/31] Update --- create_linux_installers.sh | 74 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/create_linux_installers.sh b/create_linux_installers.sh index 200b3e5..9a4d221 100755 --- a/create_linux_installers.sh +++ b/create_linux_installers.sh @@ -1,13 +1,15 @@ #!/bin/bash -VERSION="0" +VERSION=`git describe --long | sed "s/-.*//"` -OBS_BASE="https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons:/Staging:/Test" +OBS_BASE="https://download.opensuse.org/repositories/home:/Ximi1970:/Mozilla:/Add-ons" OBS_PACKAGE="systray-x" OBS_RPM_ARCHS="openSUSE_Leap_15.1/x86_64 " +OBS_RPM_ARCHS="openSUSE_Leap_15.2/x86_64 " OBS_RPM_ARCHS+="openSUSE_Tumbleweed/i586 " OBS_RPM_ARCHS+="openSUSE_Tumbleweed/x86_64 " +OBS_RPM_ARCHS+="SLE_15/x86_64 " OBS_RPM_ARCHS+="SLE_15_SP1/x86_64 " OBS_DEB_ARCHS="xUbuntu_18.04/i386 " @@ -15,6 +17,7 @@ OBS_DEB_ARCHS+="xUbuntu_18.04/amd64 " OBS_DEB_ARCHS+="xUbuntu_19.04/amd64 " OBS_DEB_ARCHS+="xUbuntu_19.10/amd64 " +mkdir -p bin pushd bin > /dev/null 2>&1 # @@ -83,4 +86,71 @@ for rpmdir in $OBS_RPM_ARCHS ; do done + +# +# Create bash installers for DEB based distributions +# +for debdir in $OBS_DEB_ARCHS ; do + # + # Get base name + # + BASE_NAME=${debdir//'/'/$'-'} + + PACKAGE_NAME=SysTray-X-$VERSION-$BASE_NAME + + rm -rf $PACKAGE_NAME + mkdir -p $PACKAGE_NAME + pushd $PACKAGE_NAME > /dev/null 2>&1 + + # + # Get index.html + # + wget -q "$OBS_BASE/$debdir/" + + # + # Find deb + # + DEB_FILE=`grep ">systray.*\.deb<" index.html | sed -e "s/.*>\(systray-x.*deb\)<.*/\1/"` + + # + # Get deb + # + wget -q "$OBS_BASE/$debdir/$DEB_FILE" + + # + # Extract + # + dpkg --fsys-tarfile $DEB_FILE | tar xOf - ./usr/bin/SysTray-X > SysTray-X + chmod 755 SysTray-X + + # + # Get JSON + # + cp -f ../../app/config/linux/SysTray_X.json.template SysTray_X.json.template + + # + # Cleanup + # + rm -f index.html + rm -f $DEB_FILE + + tar cJf ../$PACKAGE_NAME.tar.xz . + + popd > /dev/null 2>&1 + + # + # Create installer + # + cp -f ../dist/install.sh SysTray-X-$VERSION-$BASE_NAME-install.sh + cat $PACKAGE_NAME.tar.xz >> SysTray-X-$VERSION-$BASE_NAME-install.sh + chmod 755 SysTray-X-$VERSION-$BASE_NAME-install.sh + + # + # Cleanup + # + rm -rf $PACKAGE_NAME + rm -f $PACKAGE_NAME.tar.xz + +done + popd > /dev/null 2>&1 From c84f51aef3cbac52f2de85a4cf91a1930ecf0e88 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sat, 21 Mar 2020 22:34:41 +0100 Subject: [PATCH 25/31] Add windows bash commandline build --- Makefile | 34 +++++++++++++++++++++++++---- README.references.txt | 15 +++++++++++++ app/build.bat | 51 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 app/build.bat diff --git a/Makefile b/Makefile index 3495379..1c5896b 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,20 @@ -QMAKE = qmake-qt5 -ifeq (, $(shell which qmake-qt5 2>/dev/null)) - ifeq (, $(shell which qmake 2>/dev/null)) +SYSTEM = +ifeq (Cygwin,$(shell uname -o)) + SYSTEM = Windows +else +ifeq (GNU/Linux,$(shell uname -o)) + SYSTEM = Linux + + QMAKE = qmake-qt5 + ifeq (, $(shell which qmake-qt5 2>/dev/null)) + ifeq (, $(shell which qmake 2>/dev/null)) $(error "No qmake in $(PATH)") + endif + QMAKE = qmake endif - QMAKE = qmake +else + $(error "Unknown system") +endif endif .PHONY: clean \ @@ -35,6 +46,7 @@ systray-x-xpi: zip ../systray-x@Ximi1970.xpi -qr * ;\ cd .. +ifeq (Linux,$(SYSTEM)) systray-x-app: @echo "Creating systray-x app" ;\ rm -f SysTray-X ;\ @@ -44,3 +56,17 @@ systray-x-app: make ;\ cd ../.. ;\ cp app/build/SysTray-X . +else +systray-x-app: + @echo "Creating systray-x app" ;\ + rm -f SysTray-X ;\ + mkdir -p app/build32 ;\ + mkdir -p app/dist/win32 ;\ + cd app/build32 ;\ + ../build.bat x86 5.14.1 ;\ + cd ../.. ;\ + mkdir -p app/build64 ;\ + cd app/build64 ;\ + ../build.bat x86_64 5.14.1 ;\ + cd ../.. +endif diff --git a/README.references.txt b/README.references.txt index 3f2a55c..4089c1c 100644 --- a/README.references.txt +++ b/README.references.txt @@ -1,5 +1,20 @@ #