diff --git a/build.sh b/build.sh index 2f0ad23..f4ead94 100755 --- a/build.sh +++ b/build.sh @@ -10,12 +10,12 @@ G45() { elif [[ "${LINE}" = *"/* END G45 */"* ]]; then IN_G45=0 fi - if (( IN_G45 == 1 )); then - echo "${LINE}" | sed -E 's|^(\s+)?// |\1|' - elif (( IN_NON_G45 == 1 )) && ! [[ ${LINE} =~ ^[[:space:]]*// ]]; then - echo "${LINE}" | sed -E 's|^(\s+)?|\1// |' - else - echo "${LINE}" + if [[ "${LINE}" != *"/* BEGIN "* ]] && [[ "${LINE}" != *"/* END "* ]]; then + if (( IN_G45 == 1 )); then + echo "${LINE}" | sed -E 's|^(\s+)?// |\1|' + elif (( IN_NON_G45 == 0 )); then + echo "${LINE}" + fi fi if [[ "${LINE}" = *"/* BEGIN NON-G45 */"* ]]; then IN_NON_G45=1 @@ -35,12 +35,12 @@ NON_G45() { elif [[ "${LINE}" = *"/* END G45 */"* ]]; then IN_G45=0 fi - if (( IN_G45 == 1 )) && ! [[ ${LINE} =~ ^[[:space:]]*// ]]; then - echo "${LINE}" | sed -E 's|^(\s+)?|\1// |' - elif (( IN_NON_G45 == 1 )); then - echo "${LINE}" | sed -E 's|^(\s+)?// |\1|' - else - echo "${LINE}" + if [[ "${LINE}" != *"/* BEGIN "* ]] && [[ "${LINE}" != *"/* END "* ]]; then + if (( IN_NON_G45 == 1 )); then + echo "${LINE}" | sed -E 's|^(\s+)?// |\1|' + elif (( IN_G45 == 0 )); then + echo "${LINE}" + fi fi if [[ "${LINE}" = *"/* BEGIN NON-G45 */"* ]]; then IN_NON_G45=1 diff --git a/extension.js b/extension.js index 88fd496..095884c 100644 --- a/extension.js +++ b/extension.js @@ -1109,8 +1109,9 @@ var WintileExtension = class WintileExtension { changeBinding(mutterKeybindingSettings, 'toggle-tiled-left', 'Left', 'Left'); changeBinding(mutterKeybindingSettings, 'toggle-tiled-right', 'Right', 'Right'); mutterSettings.set_boolean('edge-tiling', false); + let tilingAssistantSettings; try { - let tilingAssistantSettings = new Gio.Settings({schema_id: 'org.gnome.shell.extensions.tiling-assistant'}); + tilingAssistantSettings = new Gio.Settings({schema_id: 'org.gnome.shell.extensions.tiling-assistant'}); oldbindings['restore-window'] = tilingAssistantSettings.get_strv('restore-window'); oldbindings['tile-left-half'] = tilingAssistantSettings.get_strv('tile-left-half'); oldbindings['tile-maximize'] = tilingAssistantSettings.get_strv('tile-maximize'); @@ -1188,9 +1189,6 @@ var WintileExtension = class WintileExtension { keyManager.removeAll(); keyManager.destroy(); keyManager = null; - let desktopSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.wm.keybindings'}); - let mutterKeybindingSettings = new Gio.Settings({schema_id: 'org.gnome.mutter.keybindings'}); - let mutterSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'}); try { let shellSettings = new Gio.Settings({schema_id: 'org.gnome.shell.overrides'}); shellSettings.reset('edge-tiling'); @@ -1206,7 +1204,6 @@ var WintileExtension = class WintileExtension { mutterSettings.reset('edge-tiling'); mutterSettings = null; try { - let tilingAssistantSettings = new Gio.Settings({schema_id: 'org.gnome.shell.extensions.tiling-assistant'}); tilingAssistantSettings.reset('restore-window'); tilingAssistantSettings.reset('tile-left-half'); tilingAssistantSettings.reset('tile-maximize');