3

I'm attempting to write a bash script that switches between workspaces with some dialog prompts along the way. I'm running Ubuntu 17.04 with Budgie remix.

When using wmctrl or zenity separately, they both work fine. Put them together however and budgie window manager crashes with a segmentation fault.

This happens using both wmctrl -s 0 and xdotool set_desktop 0. They work fine on their own but not in combination with zenity.

Here's my code (induces segmentation fault)

#!/bin/bash

desktop=$(xdotool get_desktop) #Get current workspace id

if [ "${desktop}" -eq 0 ] #If workspace == 0
then
  wmctrl -s 3 #Switch to workspace 3
  firefox --new-window "http://www.reddit.com"
else
    zenity --question --title "Switch Workspace?" --text "Are you sure you wish to return to previous workspace?"
    if ! $? #If response Yes
    then
      wmctrl -s 0 #Switch back
    else
      notify-send "Operation Aborted" "User canceled workspace return."
    fi
fi

Example of working code when wmctrl command is used alone

#!/bin/bash

desktop=$(xdotool get_desktop) #Get current workspace id

if [ "${desktop}" -eq 0 ] #If workspace == 0
then
  wmctrl -s 3 #Switch to workspace 3
  firefox --new-window "http://www.reddit.com"
else
  wmctrl -s 0 #Switch back
fi

Example of working code when zenity command is used alone

#!/bin/bash

desktop=$(xdotool get_desktop) #Get current workspace id

if [ "${desktop}" -eq 0 ] #If workspace == 0
then
  wmctrl -s 3 #Switch to workspace 3
  firefox --new-window "http://www.reddit.com"
else
    zenity --question --title "Switch Workspace?" --text "Are you sure you wish to return to previous workspace?"
    if ! $? #If response Yes
    then
      notify-send "Switch Workspace" "Operation placeholder."
    else
      notify-send "Operation Aborted" "User canceled workspace return."
    fi
fi

Here's what I've found within journalctl

Dec 02 11:17:54 main budgie-wm.desktop[20079]: Window manager warning: Received a NET_CURRENT_DESKTOP message from a broken (outdated) client who sent a 0 timestamp
Dec 02 11:17:54 main kernel: budgie-wm[20079]: segfault at 18 ip 00007fa255e8dfc1 sp 00007fff13189710 error 4 in libmutter-0.so.0.0.0[7fa255df0000+131000]
Dec 02 11:17:55 main gnome-session-binary[19810]: WARNING: Application 'budgie-wm.desktop' killed by signal 11
Dec 02 11:17:55 main gnome-session[19810]: gnome-session-binary[19810]: WARNING: Application 'budgie-wm.desktop' killed by signal 11
Dec 02 11:17:55 main ckb.desktop[20137]: QXcbConnection: XCB error: 148 (Unknown), sequence: 423, resource id: 0, major code: 140 (Unknown), minor code: 20
Dec 02 11:17:56 main budgie-wm[21537]: invalid (NULL) pointer instance
Dec 02 11:17:56 main budgie-wm[21537]: g_signal_connect_object: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

What is causing the segmentation fault when zenity is used to trigger the workspace switch yet both components work fine separately?

closed as off-topic by dessert, karel, Eric Carvalho, Zanna, muru Dec 6 '17 at 14:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Bug reports and problems specific to development version of Ubuntu should be reported on Launchpad so that developers can see, track and fix these issues." – dessert, karel, Eric Carvalho, Zanna, muru
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Please do not repost your question but rather edit it! – dessert Dec 2 '17 at 13:19
  • Please try xdotool set_desktop 3 (or rather 0). – dessert Dec 2 '17 at 13:26
  • 1
    @dessert, this happens using both wmctrl -s 0 and xdotool set_desktop 0. – Tom Dec 2 '17 at 13:38
  • 1
    I vote to close this question because I think it's a bug in zenity. I suggest to search for it on bugs.launchpad.net/ubuntu/+source/zenity and file a new bug if it's not already there. – dessert Dec 2 '17 at 13:56
0

Filed as bug within Zenity, see: https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1735917

Not the answer you're looking for? Browse other questions tagged or ask your own question.