.desktop files and installer scripts for linux and fixes for loading in different configs
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2021-06-16 18:01:31 -07:00
parent 30ae6ca331
commit 92577aef07
7 changed files with 71 additions and 9 deletions

View File

@ -1 +1 @@
v0.0.2-75-g854dc19-2021-06-16-21-56sta
v0.0.2-75-g854dc19-2021-06-16-21-56

10
linux/cwtch.home.desktop Executable file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Cwtch
Comment=Metadata Resistant Chat
Exec=env LD_LIBRARY_PATH=~/.local/lib/cwtch/ ~/.local/bin/cwtch
Icon=cwtch
Terminal=false
Categories=Network;InstantMessaging;
Keywords=Internet;IM;Instant Messaging;Messaging;Chat;

10
linux/cwtch.local-dir.desktop Executable file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Cwtch
Comment=Metadata Resistant Chat
Exec=env LD_LIBRARY_PATH=./lib/ ./cwtch
Icon=cwtch
Terminal=false
Categories=Network;InstantMessaging;
Keywords=Internet;IM;Instant Messaging;Messaging;Chat

10
linux/cwtch.sys.desktop Executable file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Cwtch
Comment=Metadata Resistant Chat
Exec=env LD_LIBRARY_PATH=/usr/lib/cwtch /usr/bin/cwtch
Icon=cwtch
Terminal=false
Categories=Network;InstantMessaging;
Keywords=Internet;IM;Instant Messaging;Messaging;Chat

17
linux/install-home.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
mkdir -p ~/.local/bin
cp cwtch ~/.local/bin/
mkdir -p ~/.local/share/icons
cp cwtch.png ~/.local/share/icons
mkdir -p ~/.local/share/cwtch
cp -r data ~/.local/share/cwtch
mkdir -p ~/.local/lib/cwtch
cp -r lib/* ~/.local/lib/cwtch
mkdir -p ~/.local/share/applications
sed "s|~|$HOME|g" cwtch.home.desktop > $HOME/.local/share/applications/cwtch.desktop

13
linux/install-sys.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
cp cwtch /usr/bin/
cp cwtch.png /usr/share/icons
mkdir -p /usr/share/cwtch
cp -r data /usr/share/cwtch
mkdir -p /usr/lib/cwtch
cp -r lib/* /usr/lib/cwtch
cp cwtch.sys.desktop /usr/share/applications/cwtch.desktop

View File

@ -69,7 +69,6 @@ static void my_application_activate(GApplication* application) {
gtk_window_set_title(window, "cwtch");
}
gtk_window_set_icon_from_file(window, "./cwtch.png", NULL);
gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
@ -83,20 +82,23 @@ static void my_application_activate(GApplication* application) {
const char *homedir = pw->pw_dir;
// /home/$USER/.local/share/cwtch/data/flutter_assets
project->assets_path = g_build_filename(homedir, ".local", "share", "cwtch", "data", "flutter_assets", nullptr);
// /home/$USER/bin/cwtch/lib
project->aot_library_path = g_build_filename(homedir, "bin", "cwtch", "lib", nullptr);
// /home/$USER/.local/lib/cwtch/
project->aot_library_path = g_build_filename(homedir, ".local", "lib", "cwtch", "libapp.so", nullptr);
// /home/$USER/.local/share/cwtch/data
project->icu_data_path = g_build_filename(homedir, ".local", "share", "cwtch", "data", nullptr);
project->icu_data_path = g_build_filename(homedir, ".local", "share", "cwtch", "data", "icudtl.dat", nullptr);
gtk_window_set_icon_from_file(window, g_build_filename(homedir, ".local", "share", "icons", "cwtch.png", nullptr), NULL);
} else {
// /usr/share/cwtch/data/flutter_assets
project->assets_path = g_build_filename("usr", "share", "cwtch", "data", "flutter_assets", nullptr);
project->assets_path = g_build_filename("/", "usr", "share", "cwtch", "data", "flutter_assets", nullptr);
// /usr/lib/cwtch
project->aot_library_path = g_build_filename("usr", "lib", "cwtch", nullptr);
project->aot_library_path = g_build_filename("/", "usr", "lib", "cwtch", "libapp.so", nullptr);
// /usr/share/cwtch/data
project->icu_data_path = g_build_filename("usr", "share", "cwtch", "data", nullptr);
project->icu_data_path = g_build_filename("/", "usr", "share", "cwtch", "data", "icudtl.dat", nullptr);
gtk_window_set_icon_from_file(window, "/usr/share/icons/cwtch.png", NULL);
}
} else {
gtk_window_set_icon_from_file(window, "./cwtch.png", NULL);
}
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);