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

Scripting and adding *.desktop entries for ncurses apps
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 flag.

Calcurse
~/scripts/calcurse_start.sh
Code:
#!/bin/ksh
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=/home/YOUR_USER/scripts/calcurse_start.sh
Terminal=false
Type=Application
Encoding=UTF-8
Icon=x-office-calendar
Categories=Office;Calendar;
NcMPC
~/scripts/ncmpc_start.sh
Code:
#!/bin/ksh
xterm -g 110x22 +sb -T "NcMpc Music" -e ncmpc -f ~/.config/ncmpc/ncmpcrc
~/.local/share/applications/ncmpc.desktop
Code:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=NcMPC
GenericName=MPD
Comment=MPD Frontend
Exec=/home/YOUR_USER/scripts/ncmpc_start.sh
Icon=audio-x-generic
Categories=AudioVideo;Audio;
Terminal=false

Last edited by shep; 24th May 2019 at 02:40 PM.
Reply With Quote