View Single Post
  #4   (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

x11/yad Tricks - scripting tint2/clock/calendars and abook sub-menu entries.

Tint2 does not provide a popup calendar but does have the capability to launch one. Most of the Linux based Openbox/tint2 distributions use productivity/gsimplecal which has subsequently been ported to OpenBSD. The project continues to use x11/yad to generate a calendar largely because BareGUI tries to avoid redundant applications. Yad is utilized for additional scripts and audio volume control.

The ~/scripts/calendar.sh script positions the calendar under the panel clock The code to run the calendar script is in the clock section of ~/.config/tint2/tint2rc.

mail/abook can manage multiple addressbook formats and you should be able to import your pre-existing contacts. It also supports multiple, separate address books which makes bulk emails easier although I still have to manually copy/paste the recipients to Bcc:.

Here is the yad script that itemizes my abook addressbooks:
~/scripts/yad_abook.sh
Code:
#!/bin/sh

GTK_THEME=Adwaita:dark \
yad --form --width=256 --text="Choose an Addressbook:" --title="Abook" \
--field="AirPark":fbtn 'xterm +sb -g 72x26 -T "Airpark AddressBook" -e abook --datafile /home/YOUR_USER/.config/abook/airparkaddress' \
--field="BlockWatch":fbtn 'xterm +sb -g 72x44 -T "Block AddressBook" -e abook --datafile /home/YOUR_USER/.config/abook/blockaddress' \
--field="Business":fbtn 'xterm +sb -g 72x44 -T "Business AddressBook" -e abook --datafile /home/YOUR_USER/.config/abook/bizaddress' \
--field="Family":fbtn 'xterm +sb -g 72x20 -T "Family AddressBook" -e abook --datafile /home/YOUR_USER/.config/abook/familyaddress' \
--field="Friends":fbtn 'xterm +sb -g 72x22 -T "Friends AddressBook" -e abook --datafile /home/YOUR_USER/.config/abook/friendsaddress' \
--window-icon=contact-new --button=gtk-cancel:6
You can add/delete --field lines as needed. If using a newer version of yad, the --button syntax has changed to --button=yad-cancel:6.

and the desktop entry:
~/.local/share/applications/abook.desktop
Code:
[Desktop Entry]
Name=Abook
GenericName=Contacts
Comment=Manage Contacts
Exec=~/Scripts/yad_abook.sh
Icon=x-office-address-book
Terminal=false
Type=Application
StartupNotify=false
Categories=Office;ContactManagement;

Last edited by shep; 27th August 2023 at 10:31 PM.
Reply With Quote