Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sway-launcher-desktop for 
openSUSE:Factory checked in at 2023-09-20 13:30:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sway-launcher-desktop (Old)
 and      /work/SRC/openSUSE:Factory/.sway-launcher-desktop.new.16627 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sway-launcher-desktop"

Wed Sep 20 13:30:49 2023 rev:3 rq:1112362 version:1.7.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/sway-launcher-desktop/sway-launcher-desktop.changes  
    2022-05-31 15:48:43.764041883 +0200
+++ 
/work/SRC/openSUSE:Factory/.sway-launcher-desktop.new.16627/sway-launcher-desktop.changes
   2023-09-20 13:34:35.582260277 +0200
@@ -1,0 +2,8 @@
+Tue Sep 19 18:35:10 UTC 2023 - Jan-Luca Kiok <[email protected]>
+
+- Update to version 1.7.0
+  * fix sway config entry for launcher call
+  * Check autostart condition before launching
+  * Sort desktop files alphabetical by application name
+
+-------------------------------------------------------------------

Old:
----
  v1.6.0.tar.gz

New:
----
  v1.7.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sway-launcher-desktop.spec ++++++
--- /var/tmp/diff_new_pack.NjPtq3/_old  2023-09-20 13:34:36.686299831 +0200
+++ /var/tmp/diff_new_pack.NjPtq3/_new  2023-09-20 13:34:36.686299831 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package sway-launcher-desktop
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           sway-launcher-desktop
-Version:        1.6.0
+Version:        1.7.0
 Release:        0
 Summary:        TUI Application launcher with Desktop Entry support
 License:        GPL-3.0-only

++++++ v1.6.0.tar.gz -> v1.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sway-launcher-desktop-1.6.0/README.md 
new/sway-launcher-desktop-1.7.0/README.md
--- old/sway-launcher-desktop-1.6.0/README.md   2022-05-19 14:45:55.000000000 
+0200
+++ new/sway-launcher-desktop-1.7.0/README.md   2023-09-15 17:59:12.000000000 
+0200
@@ -27,9 +27,10 @@
 Configure it in Sway like this:
 ```
 for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 
ppt 60 ppt, border pixel 10
-set $menu exec $term --class=launcher -e /path/to/repo/sway-launcher-desktop.sh
+set $menu exec $term -a launcher -e /path/to/repo/sway-launcher-desktop.sh
 bindsym $mod+d exec $menu
 ```
+(this example was made with `term=foot` in mind; it may need to be adjusted 
for other terminals)
 
 You can override the default icons/glyphs by setting the appropriate GLYPH_ 
variable in your $menu command, e.g.:
 ```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sway-launcher-desktop-1.6.0/sway-launcher-desktop.sh 
new/sway-launcher-desktop-1.7.0/sway-launcher-desktop.sh
--- old/sway-launcher-desktop-1.6.0/sway-launcher-desktop.sh    2022-05-19 
14:45:55.000000000 +0200
+++ new/sway-launcher-desktop-1.7.0/sway-launcher-desktop.sh    2023-09-15 
17:59:12.000000000 +0200
@@ -101,8 +101,9 @@
       DIRS[$i]="${DIRS[i]}/applications/**/*.desktop"
     fi
   done
+
   # shellcheck disable=SC2068
-  entries ${DIRS[@]}
+  entries ${DIRS[@]} | sort -k2
 }
 function entries() {
   # shellcheck disable=SC2068
@@ -201,9 +202,27 @@
     }' "$1"
 }
 
+function shouldAutostart() {
+    local condition="$(cat $1 | grep "AutostartCondition" | cut -d'=' -f2)"
+    local filename="${XDG_CONFIG_HOME-${HOME}/.config}/${condition#* }"
+    case $condition in
+        if-exists*)
+            [[ -e $filename ]]
+            ;;
+        unless-exists*)
+            [[ ! -e $filename ]]
+            ;;
+        *)
+            return 0
+            ;;
+    esac
+}
+
 function autostart() {
   for application in $(list-autostart); do
-    (exec setsid /bin/sh -c "$(run-desktop "${application}")" &>/dev/null &)
+      if shouldAutostart "$application" ; then
+          (exec setsid /bin/sh -c "$(run-desktop "${application}")" 
&>/dev/null &)
+      fi
   done
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/autostart-condition.bats 
new/sway-launcher-desktop-1.7.0/tests/autostart-condition.bats
--- old/sway-launcher-desktop-1.6.0/tests/autostart-condition.bats      
1970-01-01 01:00:00.000000000 +0100
+++ new/sway-launcher-desktop-1.7.0/tests/autostart-condition.bats      
2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1,20 @@
+#!/usr/bin/env bats
+
+setup() {
+    export DID_RUN="$(mktemp -d)"
+    export XDG_CONFIG_HOME=./data/autostart-folders/condition-home
+    export XDG_CONFIG_DIRS=
+}
+
+teardown() {
+    rm -r $DID_RUN
+}
+
+@test "Only starts applications with passing AutostartCondition" {
+    run ../sway-launcher-desktop.sh autostart 3>&2
+    echo -e "DID_RUN=$DID_RUN"
+    [[ ! -e $DID_RUN/unless-exists.file-exists ]]
+    [[ -e $DID_RUN/unless-exists.file-not-exists ]]
+    [[ ! -e $DID_RUN/if-exists.file-not-exists ]]
+    [[ -e $DID_RUN/if-exists.file-exists ]]
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-exists.desktop
 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-exists.desktop
--- 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-exists.desktop
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-exists.desktop
 2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Initial Setup
+Exec=touch $DID_RUN/if-exists.file-exists
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=GNOME;GTK;System;
+OnlyShowIn=GNOME;Unity;
+NoDisplay=true
+AutostartCondition=if-exists marker-file.txt
+X-GNOME-HiddenUnderSystemd=true
+X-Ubuntu-Gettext-Domain=gnome-initial-setup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-not-exists.desktop
 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-not-exists.desktop
--- 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-not-exists.desktop
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/if-exists.file-not-exists.desktop
     2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Initial Setup
+Exec=touch $DID_RUN/if-exists.file-not-exists
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=GNOME;GTK;System;
+OnlyShowIn=GNOME;Unity;
+NoDisplay=true
+AutostartCondition=if-exists non-existing-file.txt
+X-GNOME-HiddenUnderSystemd=true
+X-Ubuntu-Gettext-Domain=gnome-initial-setup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-exists.desktop
 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-exists.desktop
--- 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-exists.desktop
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-exists.desktop
     2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Initial Setup
+Exec=touch $DID_RUN/unless-exists.file-exists
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=GNOME;GTK;System;
+OnlyShowIn=GNOME;Unity;
+NoDisplay=true
+AutostartCondition=unless-exists marker-file.txt
+X-GNOME-HiddenUnderSystemd=true
+X-Ubuntu-Gettext-Domain=gnome-initial-setup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-not-exists.desktop
 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-not-exists.desktop
--- 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-not-exists.desktop
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/autostart/unless-exists.file-not-exists.desktop
 2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Initial Setup
+Exec=touch $DID_RUN/unless-exists.file-not-exists
+Terminal=false
+Type=Application
+StartupNotify=true
+Categories=GNOME;GTK;System;
+OnlyShowIn=GNOME;Unity;
+NoDisplay=true
+AutostartCondition=unless-exists non-existing-file.txt
+X-GNOME-HiddenUnderSystemd=true
+X-Ubuntu-Gettext-Domain=gnome-initial-setup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/marker-file.txt
 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/marker-file.txt
--- 
old/sway-launcher-desktop-1.6.0/tests/data/autostart-folders/condition-home/marker-file.txt
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/sway-launcher-desktop-1.7.0/tests/data/autostart-folders/condition-home/marker-file.txt
 2023-09-15 17:59:12.000000000 +0200
@@ -0,0 +1 @@
+yes

Reply via email to