From 0785d73d008e10057d7743fa79844e5b2dd2dcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jab=C5=AFrek?= Date: Sun, 18 Jul 2021 11:32:57 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20autostart=20applications=20with=20Hidde?= =?UTF-8?q?n=3Dtrue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sway-launcher-desktop.sh | 4 +++- tests/data/autostart-folders/0/autostart/vim.desktop | 7 +++++++ tests/data/autostart-folders/1/autostart/firefox.desktop | 1 + tests/data/autostart-folders/1/autostart/vim.desktop | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/data/autostart-folders/0/autostart/vim.desktop create mode 100644 tests/data/autostart-folders/1/autostart/vim.desktop diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh index 555edba..6c795be 100755 --- a/sway-launcher-desktop.sh +++ b/sway-launcher-desktop.sh @@ -227,6 +227,7 @@ function list-autostart() { BEGINFILE{ application=0; block=""; + disabled=0; a=0 id=desktopFileID(FILENAME) @@ -239,8 +240,9 @@ function list-autostart() { /^\[Desktop Entry\]/{block="entry"} /^Type=Application/{application=1} /^Name=/{ iname=$2 } + /^Hidden=true/{disabled=1} ENDFILE{ - if (application){ + if (application && !disabled){ print FILENAME; } }' \ diff --git a/tests/data/autostart-folders/0/autostart/vim.desktop b/tests/data/autostart-folders/0/autostart/vim.desktop new file mode 100644 index 0000000..21036e9 --- /dev/null +++ b/tests/data/autostart-folders/0/autostart/vim.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Version=1.0 +Name=Vim +Exec=/sbin/vim +Terminal=true +Type=Application +Hidden=true diff --git a/tests/data/autostart-folders/1/autostart/firefox.desktop b/tests/data/autostart-folders/1/autostart/firefox.desktop index c3f3b0e..df6dd74 100644 --- a/tests/data/autostart-folders/1/autostart/firefox.desktop +++ b/tests/data/autostart-folders/1/autostart/firefox.desktop @@ -1,6 +1,7 @@ [Desktop Entry] Version=1.0 Name=Firefox +Hidden=true GenericName=Web Browser GenericName[ar]=متصفح ويب GenericName[ast]=Restolador Web diff --git a/tests/data/autostart-folders/1/autostart/vim.desktop b/tests/data/autostart-folders/1/autostart/vim.desktop new file mode 100644 index 0000000..b1e6c70 --- /dev/null +++ b/tests/data/autostart-folders/1/autostart/vim.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Version=1.0 +Name=Vim +Exec=/sbin/vim +Terminal=true +Type=Application -- cgit v1.2.3