File tree Expand file tree Collapse file tree 5 files changed +19
-19
lines changed
Expand file tree Collapse file tree 5 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,9 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
176176set (CPACK_RPM_PACKAGE_LICENSE "GPLv3" )
177177set (CPACK_RPM_PACKAGE_URL "https://openbangla.org/" )
178178set (CPACK_RPM_PACKAGE_RELEASE_DIST ON )
179+ configure_file ("${CMAKE_SOURCE_DIR} /data/linux/postinst.in" "${CMAKE_BINARY_DIR} /postinst" @ONLY )
180+ set (CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR} /postinst" )
181+ set (CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR} /postinst" )
179182# Prevents CPack from generating file conflicts
180183set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/applications" "/usr/share/metainfo" "/usr/share/pixmaps"
181184 "/usr/share/icons" "/usr/share/icons/hicolor"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ @BIN_DIR@/openbangla-gui --setup-system
5+
6+ exit 0
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- /Applications/OpenBangla\ Keyboard.app/Contents/MacOS/OpenBangla\ Keyboard --setup-macos
4+ /Applications/OpenBangla\ Keyboard.app/Contents/MacOS/OpenBangla\ Keyboard --setup-system
55
66exit 0
Original file line number Diff line number Diff line change @@ -551,8 +551,7 @@ void setupInputSources() {
551551 setupLXQtIME ();
552552 } else if (de == DesktopEnvironment::macOS) {
553553 #ifdef Q_OS_MACOS
554- bool enabled = macOS::getInputSourceEnabled ();
555- LOG_DEBUG (" OpenBangla Input Source Enabled: %s\n " , enabled ? " true" : " false" );
554+ macOS::setupOpenBanglaInputSource ();
556555 #endif
557556 } else {
558557 LOG_DEBUG (" Desktop Environment not supported for input source setup\n " );
Original file line number Diff line number Diff line change @@ -45,26 +45,18 @@ int main(int argc, char *argv[]) {
4545 parser.addVersionOption ();
4646 QCommandLineOption darkIcon (" dark" ," Enable dark theme support" );
4747 QCommandLineOption startInTray (" tray" ," Start in tray" );
48+ QCommandLineOption setupSystem (" setup-system" ," Setup OpenBangla input source" );
4849 parser.addOption (darkIcon);
4950 parser.addOption (startInTray);
50-
51- #ifdef Q_OS_MACOS
52- QCommandLineOption setTIS (" setup-macos" ," Setup macOS input source" );
53- parser.addOption (setTIS);
54- #endif
55-
51+ parser.addOption (setupSystem);
5652 parser.process (app);
53+
54+ LOG_INFO (" Detected Desktop Environment: %s\n " , desktopEnvironmentToString (detectDesktopEnvironment ()).toStdString ().c_str ());
5755
58- #ifdef Q_OS_MACOS
59- if (parser.isSet (setTIS)) {
60- macOS::setupOpenBanglaInputSource ();
61- return 0 ;
62- }
63- #endif
64-
65- LOG_DEBUG (" Detected Desktop Environment: %s\n " , desktopEnvironmentToString (detectDesktopEnvironment ()).toStdString ().c_str ());
66-
67- setupInputSources ();
56+ if (parser.isSet (setupSystem)) {
57+ setupInputSources ();
58+ return 0 ;
59+ }
6860
6961 // Prevent many instances of the app to be launched
7062 QString name = " com.openbangla.keyboard" ;
You can’t perform that action at this time.
0 commit comments