From 90632558af15f9eb4a6a783ee8c9df3fdef825c9 Mon Sep 17 00:00:00 2001
From: Ivan Denisov <d.ivan.krsk@gmail.com>
Date: Thu, 4 Jan 2018 01:56:30 +0700
Subject: [PATCH] separate run script for shortcut

---
 dev/deb/template/usr/bin/bbcb-shortcut           | 16 ++++++++++++++++
 .../template/usr/share/applications/bbcb.desktop |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100755 dev/deb/template/usr/bin/bbcb-shortcut

diff --git a/dev/deb/template/usr/bin/bbcb-shortcut b/dev/deb/template/usr/bin/bbcb-shortcut
new file mode 100755
index 0000000..730a789
--- /dev/null
+++ b/dev/deb/template/usr/bin/bbcb-shortcut
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+pd="/usr/lib/blackbox"
+sd="$HOME/blackbox"
+
+# fix Ubuntu-specific problems:
+unset UBUNTU_MENUPROXY
+unset GTK_MODULES
+export LIBOVERLAY_SCROLLBAR=0
+
+mkdir -p $sd
+
+# export LD_DEBUG=all
+env \
+	BB_PRIMARY_DIR="${pd}" BB_SECONDARY_DIR="${sd}" \
+	"${pd}"/blackbox
diff --git a/dev/deb/template/usr/share/applications/bbcb.desktop b/dev/deb/template/usr/share/applications/bbcb.desktop
index 28cfd5b..772d2da 100644
--- a/dev/deb/template/usr/share/applications/bbcb.desktop
+++ b/dev/deb/template/usr/share/applications/bbcb.desktop
@@ -2,7 +2,7 @@
 Encoding=UTF-8
 Name=BlackBox Component Builder for Linux
 Comment=IDE and component framework for programming language Component Pascal
-Exec=/usr/bin/bbcb
+Exec=/usr/bin/bbcb-shortcut
 Path=
 Icon=/usr/share/pixmaps/blackbox.svg
 Categories=Development;
-- 
2.29.2