View Single Post
  #3   (View Single Post)  
Old 18th October 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Scripting and adding *.desktop entries for ncurses apps
For those new to scripts, they need to be executable. Executable permissions can be lost during archive/compression and if they do not function, chmod +x the script.
Ncurses applications are lightweight, responsive applications that run in a terminal. One issue is that the terminal may need to be resized to fully display the application. I do this by running a shell script that sets the xterm size and then executes the Ncurses application. The shell script is then executed by the *.desktop entry. When setting the geometry initially, you can mouse drag the corner of the xterm, running the ncurses app, and adjust. The changes in the geometry are displayed in a pop-up as long as the mouse button remains depressed. Note the geometry when it looks good and enter it after the xterm -g(geometry) flag.

productivity/calcurse is now provided by default but makes a good example to walk through adding an ncurses application.

Code:
# pkg_add calcurse
Calcurse
~/Scripts/calcurse_start.sh
Code:
#!/bin/sh
xterm -g 65x30 +sb -T "Calcurse Calendar" -e calcurse
with the following:
~/.local/share/applications/calcurse.desktop
Code:
[Desktop Entry]
Name=Calcurse
GenericName=Calendar
Comment=Calendar
Exec=~/Scripts/calcurse_start.sh
Terminal=false
Type=Application
Encoding=UTF-8
Icon=x-office-calendar
Categories=Office;Calendar;

Last edited by shep; 13th April 2023 at 10:16 PM.
Reply With Quote