Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4971b64
shorter swoosh
teamcons Nov 1, 2025
72227a5
Merge branch 'Better-code' of https://github.com/ellie-commons/Jorts …
teamcons Nov 1, 2025
1d7f578
Merge branch 'main' into Better-code
teamcons Nov 1, 2025
1f07318
initial windows files
teamcons Nov 1, 2025
e977ee7
use meson to gate windows specific build things
Nov 1, 2025
bf50c12
Merge branch 'main' into Better-code
teamcons Nov 2, 2025
411cfbb
more elegant meson and further tidyup
Nov 2, 2025
a52a935
have script not needing admin
Nov 2, 2025
ad222b2
Trim size of installer by removing fonts and folders
Nov 2, 2025
eada03a
minor fixes
Nov 2, 2025
ae23753
font support in nsis
teamcons Nov 3, 2025
b2062dd
autostart
teamcons Nov 3, 2025
c2f7af9
Add missing link to delete
teamcons Nov 3, 2025
d95a4e1
remove annoying dialog, allow run
teamcons Nov 3, 2025
8ea638b
clean the mess up a bit
teamcons Nov 3, 2025
3951dbe
restore some icons
teamcons Nov 3, 2025
6674e7c
emotes
teamcons Nov 3, 2025
ad01c39
icons
teamcons Nov 3, 2025
1c08dec
add more icons
teamcons Nov 3, 2025
dbd317c
fix in missing icons
teamcons Nov 3, 2025
6c644cb
Better deploy
teamcons Nov 5, 2025
3d95cdb
Add build icon in executable and gate more linux stuff with meson
teamcons Nov 5, 2025
531e0b8
make it neater
teamcons Nov 5, 2025
f884bc8
Move data into a dedicated folder on windows
teamcons Nov 5, 2025
bfa3d65
Do icon variants
teamcons Nov 5, 2025
9233070
oops
teamcons Nov 5, 2025
2819975
ctrl+q
teamcons Nov 5, 2025
16006f8
add windres
teamcons Nov 5, 2025
f13f12c
add mini
teamcons Nov 5, 2025
a9eaee6
fix app icon showing up and minor typos
Nov 5, 2025
2d39e25
correctly install font
Nov 5, 2025
228a7f8
save this before its lost
Nov 5, 2025
391bba2
invert slashes
Nov 5, 2025
8fa4aed
revert slashes
Nov 5, 2025
6ffd768
Oh it works
Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ generate_stylesheets.sh
.flatpak/
.potrans
.editorconfig
oldpng/
oldpng/
deploy/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ flatpak run io.github.ellie_commons.jorts --preferences

Theres none. The app closes on its own when no window is open. Doesn't make sense to use resources if unused.

If you want to quit everything at once, use Ctrl+Q


### Where close note

Expand Down
79 changes: 42 additions & 37 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,53 @@ install_data (
rename: meson.project_name() + '.gschema.xml'
)

#======== Internationalization ========
#Translate and install our .desktop file
i18n.merge_file(
input: 'jorts.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'desktop',
install: true,
install_dir: get_option('datadir') / 'applications'
)
# metainfo confuses windows, and icons are
if not windows_build

#Translate and install our .metainfo file
i18n.merge_file(
input: 'jorts.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
po_dir: meson.project_source_root() / 'po' / 'extra',
install: true,
install_dir: get_option('datadir') / 'metainfo'
)
#======== Internationalization ========
#Translate and install our .desktop file
i18n.merge_file(
input: 'jorts.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'desktop',
install: true,
install_dir: get_option('datadir') / 'applications'
)

#======== Metainfo ========
#Translate and install our .metainfo file
i18n.merge_file(
input: 'jorts.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
po_dir: meson.project_source_root() / 'po' / 'extra',
install: true,
install_dir: get_option('datadir') / 'metainfo'
)

#======== ICONS ========
#======== ICONS ========
# Install our icons in all the required sizes
# "variant" variable has been declared earlier in the base meson
icon_sizes = ['16', '24', '32', '48', '64', '128']

# Install our icons in all the required sizes
# "variant" variable has been declared earlier in the base meson
icon_sizes = ['16', '24', '32', '48', '64', '128']
foreach i : icon_sizes
install_data(
'icons' / variant / 'hicolor' / i + '.png',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
rename: meson.project_name() + '.png'
)
install_data(
'icons' / variant / 'hicolor@2' / i + '@2.png',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
rename: meson.project_name() + '.png'
)
endforeach

foreach i : icon_sizes
install_data(
'icons' / variant / 'hicolor' / i + '.png',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
rename: meson.project_name() + '.png'
'icons' / variant / 'scalable.svg',
install_dir: get_option('datadir') / 'icons' / 'scalable' / 'apps',
rename: meson.project_name() + '.svg'
)
install_data(
'icons' / variant / 'hicolor@2' / i + '@2.png',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
rename: meson.project_name() + '.png'
)
endforeach

install_data(
'icons' / variant / 'scalable.svg',
install_dir: get_option('datadir') / 'icons' / 'scalable' / 'apps',
rename: meson.project_name() + '.svg'
)
endif

24 changes: 22 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ i18n = import('i18n')

add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')

if build_machine.system() == 'windows'
windows_build = true
else
windows_build = false
endif


vala_flags = []
variant = get_option('variant')[0]
Expand All @@ -20,9 +26,17 @@ else
vala_flags = ['--define', 'DEFAULT']
endif

add_project_arguments(vala_flags, language: 'vala')

if windows_build
vala_flags += ['--define', 'WINDOWS']
endif





add_project_arguments(vala_flags, language: 'vala')

#================================
# Import the stylesheet

Expand All @@ -49,10 +63,16 @@ dependencies = [
dependency('json-glib-1.0'),
dependency('gee-0.8'),
dependency('gtk4'),
dependency('libportal')
]

if windows_build
dependencies += dependency('gio-windows-2.0')
ico_src = import('windows').compile_resources('windows/icons/ico.rc')

else
dependencies += dependency('gio-unix-2.0')
dependencies += dependency('libportal')
endif

#================================

Expand Down
7 changes: 7 additions & 0 deletions src/Services/Storage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ public class Jorts.Storage : Object {

/*************************************************/
construct {

#if WINDOWS
// In Windows we arent in a sandbox, so we need to have some courtesy and not dump in the allfolder
data_directory = GLib.Path.build_path("/", Environment.get_user_data_dir (), "io.github.ellie_commons.jorts");
#else
data_directory = Environment.get_user_data_dir ();
#endif

storage_path = data_directory + "/" + FILENAME;
check_if_stash ();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Views/PreferencesView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
/****************************************************/
/* Autostart Request */
/****************************************************/
#if !WINDOWS

Xdp.Portal portal = new Xdp.Portal ();
GenericArray<weak string> cmd = new GenericArray<weak string> ();
Expand Down Expand Up @@ -148,7 +149,7 @@
autostart_box.append (autostart_label);
autostart_box.append (both_buttons);
settingsbox.append (autostart_box);

#endif
/*************************************************/
// Bar at the bottom
var actionbar = new Gtk.CenterBox () {
Expand Down
2 changes: 1 addition & 1 deletion src/Windows/StickyNoteWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
* This is more for the Aesthetic
*/
private void delayed_show () {
Timeout.add_once (750, () => {
Timeout.add_once (250, () => {
Application.gsettings.bind (
"hide-bar",
view.actionbar.actionbar,
Expand Down
10 changes: 9 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sources = files (

'Utils' / 'ZoomConvert.vala',
'Utils' / 'Random.vala',
'Utils' / 'Libportal.vala',

'Services' / 'Constants.vala',
'Services' / 'Storage.vala',
Expand All @@ -31,13 +30,22 @@ sources = files (
'Application.vala',
)

if windows_build
sources += ico_src
else
sources += files('Utils' / 'Libportal.vala')
endif

#================================
# Let's define our executable
# win_subsystem doesnt seem to bother standard builds

executable(
meson.project_name(),
gresource,
config_file,
sources,
dependencies: dependencies,
win_subsystem: 'windows',
install : true
)
Binary file added windows/Jorts-Installer.exe
Binary file not shown.
140 changes: 140 additions & 0 deletions windows/Jorts-Installer.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
!include "MUI2.nsh"
!include WinMessages.nsh

Name Jorts

Outfile "Jorts-Installer.exe"
InstallDir "$LOCALAPPDATA\Programs\Jorts"

# RequestExecutionLevel admin ; Request administrative privileges
RequestExecutionLevel user

# Set the title of the installer window
Caption "Jorts Installer"

# Set the title and text on the welcome page
!define MUI_WELCOMEPAGE_TITLE "Welcome to Jorts setup"
!define MUI_WELCOMEPAGE_TEXT "This bitch will guide you through the installation of Jorts."
!define MUI_INSTFILESPAGE_TEXT "Please wait while Jorts is being installed."
!define MUI_ICON "icons\install.ico"
!define MUI_UNICON "icons\uninstall.ico"
!define MUI_FINISHPAGE_RUN "$SMPROGRAMS\Startup\Jorts.lnk"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

!macro GetCleanDir INPUTDIR
; ATTENTION: USE ON YOUR OWN RISK!
; Please report bugs here: http://stefan.bertels.org/
!define Index_GetCleanDir 'GetCleanDir_Line${__LINE__}'
Push $R0
Push $R1
StrCpy $R0 "${INPUTDIR}"
StrCmp $R0 "" ${Index_GetCleanDir}-finish
StrCpy $R1 "$R0" "" -1
StrCmp "$R1" "\" ${Index_GetCleanDir}-finish
StrCpy $R0 "$R0\"
${Index_GetCleanDir}-finish:
Pop $R1
Exch $R0
!undef Index_GetCleanDir
!macroend

; ################################################################
; similar to "RMDIR /r DIRECTORY", but does not remove DIRECTORY itself
; example: !insertmacro RemoveFilesAndSubDirs "$INSTDIR"
!macro RemoveFilesAndSubDirs DIRECTORY
; ATTENTION: USE ON YOUR OWN RISK!
; Please report bugs here: http://stefan.bertels.org/
!define Index_RemoveFilesAndSubDirs 'RemoveFilesAndSubDirs_${__LINE__}'

Push $R0
Push $R1
Push $R2

!insertmacro GetCleanDir "${DIRECTORY}"
Pop $R2
FindFirst $R0 $R1 "$R2*.*"
${Index_RemoveFilesAndSubDirs}-loop:
StrCmp $R1 "" ${Index_RemoveFilesAndSubDirs}-done
StrCmp $R1 "." ${Index_RemoveFilesAndSubDirs}-next
StrCmp $R1 ".." ${Index_RemoveFilesAndSubDirs}-next
IfFileExists "$R2$R1\*.*" ${Index_RemoveFilesAndSubDirs}-directory
; file
Delete "$R2$R1"
goto ${Index_RemoveFilesAndSubDirs}-next
${Index_RemoveFilesAndSubDirs}-directory:
; directory
RMDir /r "$R2$R1"
${Index_RemoveFilesAndSubDirs}-next:
FindNext $R0 $R1
Goto ${Index_RemoveFilesAndSubDirs}-loop
${Index_RemoveFilesAndSubDirs}-done:
FindClose $R0

Pop $R2
Pop $R1
Pop $R0
!undef Index_RemoveFilesAndSubDirs
!macroend

Section "Install"
SetOutPath "$INSTDIR"
File /r "deploy\*"
CreateDirectory $SMPROGRAMS\Jorts

; fonts. We install to local fonts to not trip up admin rights, and register for local user
SetOutPath "$LOCALAPPDATA\Microsoft\Windows\Fonts"
File "fonts\RedactedScript-Regular.ttf"
WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\Fonts" "Redacted Script Regular (TrueType)" "$LOCALAPPDATA\Microsoft\Windows\Fonts\RedactedScript-Regular.ttf"
; SendMessage 0 0 /TIMEOUT=5000

; Start menu
CreateShortCut "$SMPROGRAMS\Jorts\Jorts.lnk" "$INSTDIR\bin\io.github.ellie_commons.jorts.exe" "" "$INSTDIR\icons\icon-mini.ico" 0

; Autostart
CreateShortCut "$SMPROGRAMS\Startup\Jorts.lnk" "$INSTDIR\bin\io.github.ellie_commons.jorts.exe" "" "$INSTDIR\icons\icon-mini.ico" 0

; Preferences
CreateShortCut "$SMPROGRAMS\Jorts\Preferences of Jorts.lnk" "$INSTDIR\bin\io.github.ellie_commons.jorts.exe" "--preferences" "$INSTDIR\icons\settings-mini.ico" 0

WriteRegStr HKCU "Software\Jorts" "" $INSTDIR
WriteUninstaller "$INSTDIR\Uninstall.exe"

; Add to Add/Remove programs list
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "DisplayName" "Jorts"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "InstallLocation" "$INSTDIR\"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts" "Publisher" "Ellie-Commons"
SectionEnd

Section "Uninstall"

; Remove Start Menu shortcut
Delete "$SMPROGRAMS\Jorts\Jorts.lnk"
Delete "$SMPROGRAMS\Jorts\Preferences of Jorts.lnk"
Delete "$SMPROGRAMS\Startup\Jorts.lnk"

; Remove uninstaller
Delete "$INSTDIR\Uninstall.exe"

; Remove files and folders
!insertmacro RemoveFilesAndSubDirs "$INSTDIR"

; Remove directories used
RMDir $SMPROGRAMS\Jorts
RMDir "$INSTDIR"

; Remove registry keys
DeleteRegKey HKCU "Software\Jorts"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Jorts"

SectionEnd

Loading