The officially official Devuan Forum!

You are not logged in.

#1 2020-07-25 20:56:12

Vernon
Member
Registered: 2020-07-19
Posts: 89  

HOWTO: Install the best calculator for programmers - ycalc

Ycalc is a light-weight programmable calculator for X based on the TI-58/59 which allows you to create keypress macros. An example of how to program ycalc is here. But what really sets ycalc apart is its binary mode. When you press the Bin key, a window appears with three rows of binary numbers where you can toggle bits, shift bits and perform logical operations such as Xor (exclusive or).

Ycalc with Binary Window

Since Ycalc is not packaged, we need to build it from source.

Install the needed build packages

As root, issue the following command.

apt-get install build-essential libx11-dev
Get the source code
wget http://pet.orbin.se/ycalc-mob-1.09.1-src.tar.gz 
Extract the source code
tar -xvzf ycalc-mob-1.09.1-src.tar.gz 
Build the source code
cd ycalc-mob-1.09.1-src
make
Run ycalc
./ycalc-mob
Change ycalc size

Ycalc was written at a time when high resolution displays were 640x480. As such, ycalc may appear too small for you. To make ycalc larger, issue the following commands.

sed -i '225s/.*/#define DEFAULTFONT   "9x15"/' main.c
make

Run ycalc again and ./ycalc-mob to see if you like the size better. If not, repeat the last two steps with a different fond size.

To get a list of possible fonts and font sizes, issue the following command.

xlsfonts | grep '^[6-9]x'
Install ycalc on your system

As root, issue the follow commands

cp ycalc-mob /usr/local/bin/ycalc
mkdir /usr/local/man/man1
gzip -c ycalc-mob.1 > /usr/local/man/man1/ycalc.1.gz
Add ycalc to your LXQt Desktop

The following was tested with a clean Devuan Beowulf installation with the LXQt desktop. In theory, this should work with XFCE as well. As root, use your favorite text editor to create text file /usr/share/applications/ycalc.desktop with the following contents.

[Desktop Entry]
Version=1.0
Type=Application
Name=Calculator
Exec=ycalc
Icon=accessories-calculator
Categories=Utility;Calculator

You should now have an entry named Calculator in your Accesories menu.

Last edited by Vernon (2020-07-26 01:27:29)

Offline

#2 2020-07-26 11:33:30

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: HOWTO: Install the best calculator for programmers - ycalc

Vernon wrote:

Since Ycalc is not packaged, we need to build it from source

No, we need to package it up smile

I've built versions for stable, testing & unstable in various architectures:

https://software.opensuse.org//download … =ycalc-mob

They were built in Debian containers but should be fully compatible with Devuan, probably best to just grab the .deb package and install that — the software is ancient and unlikely to be updated.

EDIT: updated to v1.09.1-2 with added man page big_smile

Last edited by Head_on_a_Stick (2020-07-26 11:41:14)


Brianna Ghey — Rest In Power

Offline

#3 2020-07-26 13:23:18

Vernon
Member
Registered: 2020-07-19
Posts: 89  

Re: HOWTO: Install the best calculator for programmers - ycalc

Head_on_a_Stick wrote:

I've built versions for stable, testing & unstable in various architectures:

https://software.opensuse.org//download … =ycalc-mob

They were built in Debian containers but should be fully compatible with Devuan, probably best to just grab the .deb package and install that — the software is ancient and unlikely to be updated.

Thanks for doing this. The only packages I know how to make are for Slackware.

Offline

Board footer