ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.41k stars 63 forks source link

[Bug] trouble launching bash script #377

Closed teto closed 9 months ago

teto commented 10 months ago

Please read through the README and the Man pages before submitting Please also make sure that there isn't any prior issue describing this bug

Describe the bug

I am trying to achieve https://github.com/ErikReider/SwayNotificationCenter/issues/323, i.e. copying the content of the notification on click. For some reason it didn't work so I tried to debug the env via:

  "scripts": {
    "example-action-script": {
      "exec": "bash -c '/usr/bin/env > /home/teto/swaync-test.txt'",
      "run-on": "action"
    }
  },

but this triggers:

Jan 29 08:25:27 jedha swaync[231086]: >: -c: line 1: unexpected EOF while looking for matching `''

while I can copy the command in shell just fine. Could it be some parsing issue ?

Expected behavior A clear and concise description of what you expected to happen.

Please provide logs if you're experiencing notification errors / bugs

Attach Gists for swaync logs by running G_MESSAGES_DEBUG=all swaync and (if applicable) application logs.

Jan 29 10:57:36 jedha systemd[3470]: Starting Swaync notification daemon...
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/interface/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/peripherals/mouse/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/sound/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/privacy/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/wm/preferences/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/a11y/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/gnome/desktop/a11y/interface/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/interface/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/peripherals/mouse/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/sound/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/privacy/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/wm/preferences/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/a11y/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/gnome/desktop/a11y/interface/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: Compositor prefers decoration mode 'server'
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: unsetenv() is not thread-safe and should not be used after threads are created
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_fast: "/org/erikreider/swaync/" (establishing: 0, active: 0)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: watch_established: "/org/erikreider/swaync/" (establishing: 1)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: configModel.vala:334: {
                                                 "positionX" : "right",
                                                 "positionY" : "top",
                                                 "layer" : "top",
                                                 "layer-shell" : true,
                                                 "cssPriority" : "application",
                                                 "timeout" : 10,
                                                 "timeout-low" : 5,
                                                 "timeout-critical" : 6,
                                                 "transition-time" : 200,
                                                 "keyboard-shortcuts" : true,
                                                 "image-visibility" : "when-available",
                                                 "notification-window-width" : 500,
                                                 "hide-on-clear" : false,
                                                 "hide-on-action" : true,
                                                 "control-center-positionX" : "none",
                                                 "control-center-positionY" : "none",
                                                 "control-center-margin-top" : 0,
                                                 "control-center-margin-bottom" : 0,
                                                 "control-center-margin-left" : 0,
                                                 "control-center-margin-right" : 0,
                                                 "control-center-layer" : "top",
                                                 "categories-settings" : {  },
                                                 "notification-visibility" : {  },
                                                 "scripts" : {
                                                   "example-action-script" : {
                                                     "exec" : "bash -c '/usr/bin/env > /home/teto/swaync-test.txt'",
                                                     "run-on" : "action"
                                                   }
                                                 },
                                                 "script-fail-notify" : true,
                                                 "fit-to-screen" : true,
                                                 "control-center-height" : 600,
                                                 "control-center-width" : 500,
                                                 "notification-2fa-action" : true,
                                                 "notification-inline-replies" : false,
                                                 "notification-icon-size" : 64,
                                                 "notification-body-image-height" : 100,
                                                 "notification-body-image-width" : 200,
                                                 "widgets" : [
                                                   "buttons-grid",
                                                   "menubar#label",
                                                   "backlight",
                                                   "mpris",
                                                   "volume",
                                                   "inhibitors",
                                                   "title",
                                                   "dnd",
                                                   "notifications"
                                                 ],
                                                 "widget-config" : {
                                                   "buttons-grid" : {
                                                     "actions" : [
                                                       {
                                                         "label" : "直",
                                                         "command" : "~/.config/rofi/rofi-wifi-menu.sh"
                                                       },
                                                       {
                                                         "label" : "<U+F5AE>",
                                                         "command" : "~/.config/rofi/rofi-bluetooth"
                                                       },
                                                       {
                                                         "label" : "<U+F011>",
                                                         "command" : "notify-send -m 'toto'",
                                                         "type" : "toggle"
                                                       },
                                                       {
                                                         "label" : "<U+F011>",
                                                         "command" : "wlogout"
                                                       }
                                                     ]
                                                   },
                                                   "volume" : {
                                                     "label" : "<U+F028>"
                                                   },
                                                   "menubar#label" : {
                                                     "menu#power-buttons" : {
                                                       "label" : "<U+F011>",
                                                       "position" : "right",
                                                       "actions" : [
                                                         {
                                                           "label" : "<U+F021> Reboot",
                                                           "command" : "systemctl reboot"
                                                         },
                                                         {
                                                           "label" : "<U+F023> Lock",
                                                           "command" : "swaylock -f --image ~/.config/wallpapers/snow_woods.jpg"
                                                         },
                                                         {
                                                           "label" : "<U+F08B> Logout",
                                                           "command" : "swaymsg exit"
                                                         },
                                                         {
                                                           "label" : "<U+F011> Shut down",
                                                           "command" : "systemctl poweroff"
                                                         }
                                                       ]
                                                     },
                                                     "menu#powermode-buttons" : {
                                                       "label" : "<U+F829>",
                                                       "position" : "left",
                                                       "actions" : [
                                                         {
                                                           "label" : "Performance",
                                                           "command" : "powerprofilesctl set performance"
                                                         },
                                                         {
                                                           "label" : "Balanced",
                                                           "command" : "powerprofilesctl set balanced"
                                                         },
                                                         {
                                                           "label" : "Power-saver",
                                                           "command" : "powerprofilesctl set power-saver"
                                                         }
                                                       ]
                                                     },
                                                     "buttons#topbar-buttons" : {
                                                       "position" : "left",
                                                       "actions" : [
                                                         {
                                                           "label" : "<U+F5FF>",
                                                           "command" : "grim"
                                                         }
                                                       ]
                                                     }
                                                   },
                                                   "backlight" : {
                                                     "label" : "<U+F5DD>",
                                                     "device" : "intel_backlight",
                                                     "min" : 10
                                                   },
                                                   "inhibitors" : {
                                                     "text" : "Inhibitors",
                                                     "button-text" : "Clear All Notifs",
                                                     "clear-all-button" : true
                                                   },
                                                   "title" : {
                                                     "text" : "Notifications TITLE",
                                                     "clear-all-button" : true,
                                                     "button-text" : "Clear All (or not)"
                                                   },
                                                   "dnd" : {
                                                     "text" : "Do Not Disturb"
                                                   },
                                                   "label" : {
                                                     "max-lines" : 5,
                                                     "text" : "Label Text"
                                                   },
                                                   "mpris" : {
                                                     "image-size" : 96,
                                                     "image-radius" : 12
                                                   }
                                                 }
                                               }
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: buttons-grid
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-duration!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-type!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: menubar.vala:176: No animation-type for menu-object given using default
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-duration!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-type!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: menubar.vala:176: No animation-type for menu-object given using default
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: label!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: menubar.vala:167: No label for menu-object given using default
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-duration!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: menubar#label: Config doesn't have key: animation-type!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: menubar.vala:176: No animation-type for menu-object given using default
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: menubar
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: backlight: Config doesn't have key: subsystem!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: backlightUtil.vala:41: Could not find device /sys/class/backlight/intel_backlight/brightness
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: backlight
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: mpris
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: show-per-app!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: empty-list-label!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: expand-button-label!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: collapse-button-label!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: icon-size!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: animation-duration!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: baseWidget.vala:47: volume: Config doesn't have key: animation-type!
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: volume
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: inhibitors
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: title
Jan 29 10:57:36 jedha .swaync-wrapped[734696]: factory.vala:42: Loading widget: dnd
Jan 29 10:57:36 jedha systemd[3470]: Started Swaync notification daemon.
Jan 29 10:58:05 jedha .swaync-wrapped[734696]: notiDaemon.vala:171: Notification: 
                                               category:                 (null)
                                               image_data:                 false
                                               expire_timeout:                 -1
                                               replaces_id:                 0
                                               desktop_entry:                 (null)
                                               body:                         
                                               app_icon:                 
                                               action_icons:                 false
                                               time:                         1706522285
                                               hints:                 
                                                       sender-pid: int64 735084
                                                       urgency: byte 0x01
                                               applied_id:                 1
                                               image_path:                 (null)
                                               inline-reply:                 (null)
                                               app_name:                 notify-send
                                               summary:                 toto
                                               icon_data:                 false
                                               resident:                 false
                                               default_action:                 (null)
                                               actions:                 
                                               urgency:                 Normal
Jan 29 10:58:07 jedha swaync[735125]: >: -c: line 1: unexpected EOF while looking for matching `''

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

ErikReider commented 9 months ago

Have you tried the lastest commit? Works on my end

Sohail-XD commented 9 months ago

Can confirm that this problem doesn't exist in 0.10.0

ErikReider commented 9 months ago

Is this still an issue?

Sohail-XD commented 9 months ago

Working fine on my end

teto commented 9 months ago

I've just updated locally the nix package from 0.9 to 0.10 and it worked ty.

teto commented 9 months ago

@ErikReider the granite dependency is a package from the pantheon project right ? If you wanna have a look https://github.com/NixOS/nixpkgs/pull/290627 I had to add sassc which seems like a new dependency

ErikReider commented 9 months ago

@ErikReider the granite dependency is a package from the pantheon project right ?

Yep. It's a neat GTK lib :)

If you wanna have a look NixOS/nixpkgs#290627 I had to add sassc which seems like a new dependency

Awesome! Thanks for maintaining the nix pkg :)

leon-erd commented 9 months ago

@ErikReider What are granite and gvfs needed for? And they are runtime dependencies and not buildtime right?