Text-Popover is a MacOS menu bar app that pops up at user-specified intervals. These pop-ups contain user-specified texts, such as inspirational quotes or idioms, which are stored in SQLite databases in the text-popover-macOSDatabaseFiles/
directory. Language learners could use these pop-ups as virtual placards. The app is written in the SwiftUI framework.
Light mode | Dark mode |
---|---|
- This button closes the app.
- This button takes you to the next page of the popover, which shows any additional text that you might want to display.
- This is the amount of time remaining in hours and minutes before the text changes to the next available one in the current database. If the Mac goes to sleep whilst the app is still running, the time will be updated accordingly when the Mac wakes up.
- This button opens the settings window.
- This is the user-defined main text for display. In the image above, the main text (Expression) is a German idiom.
- This is a user-defined sub-text for display. It can be blank. In the image, the sub-text (Explanation) is the meaning of the German idiom.
- This button takes you back to the main page of the popover.
- This is a user-defined sub-text (Elaboration) for display. It can be blank. In the image, the sub-text is the history behind the German idiom.
- This segment sets the interval between changes in the text displayed in the popover. When the interval is up, the text is updated to the next available one in the current database, and the time is reset. The default interval is 24 hours.
- This segment sets the sound played when the text in the popover is updated. By default, no sound is played. Drag on the slider to adjust the volume of the sound. By default, the sound is played at a maximal volume. In addition, by default, the popover appears automatically on the screen when the text gets updated. However, you have the option to turn off this pop-up behaviour, such that when the current interval is up, the text in the popover will still get updated but the popover will not appear on the screen.
- This segment allows you to decide whether or not to display the sub-texts (Explanation and Elaboration). After all, they could sometimes be blank. By default, the Explanation is displayed but the Elaboration (together with the blue button in the popover) is not.
- This segment allows you to set the appearance of the popover to either light or dark mode. The default appearance is dark mode.
The default database contains German idioms (Redewendungen). Every time the app is restarted, the default database is automatically built from scratch. This is done by using the Python library Beautiful Soup to scrape the idioms, as well as their meaning and history, from Wikipedia. Python is not required for any further databases that you may wish to add.
- Click this button if you wish to add a new database.
- Input the name of your new database and click 'Create'.
- The list of databases on the left will automatically be updated. Click on the name of your new database.
- Input as many entries as you like. The Explanation and Elaboration are optional but the Expression cannot be left blank.
- If you no longer want an entry, you can remove it from your database.
The popover will display entries from the new database as long as it is selected in the settings window.
- Click on this button if you no longer want a database, and then click 'Yes' to confirm deletion.
All databases are added to the text-popover-macOSDatabaseFiles/
directory. From within the app, you cannot delete the default database "Redewendungen". Neither can you add any new entries to the default database nor remove any entries from it. For more information, please refer to the README of that directory.
- Xcode (we used version 12.4)
- Carthage (can be downloaded using Homebrew)
- Python 3 with Beautiful Soup (we used version 4.9.1) installed
- Download the source code by clicking on the green 'Code' button on this website. Alternatively, clone the repository by first navigating to the path where you want to store the local copy and then running the following command in the Terminal:
git clone https://github.com/liweiyap/text-popover-macOS.git
- Install the SQLite.swift dependency using Carthage.
- Navigate to the root directory of the repository and run the following command in the Terminal:
This will produce a 'Carthage' folder in the root directory of the repository.
carthage update --platform macOS
- Navigate to 'Carthage > Checkouts > SQLite.swift' and open the file 'SQLite.xcodeproj' in Xcode.
- Set
Build Libraries for Distribution
toYes
and close the file 'SQLite.xcodeproj'. - Return to the root directory of the repository and run the following command in the Terminal:
carthage build --platform macOS
- Now, open the main file 'text-popover-macOS.xcodeproj' in Xcode.
- In the 'General' settings tab of the 'text-popover-macOS' target, scroll down to the section 'Frameworks, Libraries, and Embedded Content'. Drag and drop the entire 'Carthage/Build/Mac/SQLite.framework' folder into this section.
- Navigate to the root directory of the repository and run the following command in the Terminal:
- Build and run the app in Xcode by clicking on the triangular icon at the top left corner of the screen.
- Check if we really need the SQLite.swift dependency. After all, it is just a wrapper, and it has not really been properly maintained since at least July 2020. Follow this tutorial. This might help us to resolve this issue.
-
NSUserDefaults
to store user preferences across different launches of app (see here). - Consider replacing
print
statements and exceptions withAlert
s. - When database is selected in
DatabaseList
, perhaps we should show a scrollable list of availableExpression
s first, instead ofDatabaseAdderAndRemover
. - Make certain texts selectable.
MIT © 2021 Li-Wei Yap