在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):insanum/gcalcli开源软件地址(OpenSource Url):https://github.com/insanum/gcalcli开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):gcalcliGoogle Calendar Command Line Interfacegcalcli is a Python application that allows you to access your Google Calendar(s) from a command line. It's easy to get your agenda, search for events, add new events, delete events, edit events, see recently updated events, and even import those annoying ICS/vCal invites from Microsoft Exchange and/or other sources. Additionally, gcalcli can be used as a reminder service and execute any application you want when an event is coming up. gcalcli uses the Google Calendar API version 3. Requirements
Optional packages
InstallationCheck your OS distribution for packages. Debian/Ubuntuapt-get install gcalcli NixInstall usingnix-env -i gcalcli Homebrew (MacOS)Install usingbrew install gcalcli Install from PyPIpip install gcalcli Install from sourcegit clone https://github.com/insanum/gcalcli.git
cd gcalcli
python setup.py install Install optional packagepip install vobject Features
ScreenshotsHowToUsage
See the manual ( Login InformationOAuth2 is used for authenticating with your Google account. The resulting token is placed in the ~/.gcalcli_oauth file. When you first start gcalcli the authentication process will proceed. Simply follow the instructions. If desired, you can use your own Calendar API instead of the default API values. NOTE: these steps are optional!
HTTP Proxy Supportgcalcli will automatically work with an HTTP Proxy simply by setting up some environment variables used by the gdata Python module:
Note that these environment variables must be lowercase. Flag File
In the current version, the flag file only supports the global options (options
against the Example:
Note that long options require an equal sign if specifying a parameter. With short options the equal sign is optional. Configuration Foldersgcalcli is able to store all its necessary information in a specific folder (use the --configFolder option.) Each folder will contain 2 files: oauth and cache. An optional 3rd file, gcalclirc, can be present for specific flags that you only want to apply when using this configuration folder. Importing VCS/VCAL/ICS Files from Exchange (or other)Importing events from files is easy with gcalcli. The 'import' command accepts a filename on the command line or can read from standard input. Here is a script that can be used as an attachment handler for Thunderbird or in a mailcap entry with Mutt (or in Mutt you could just use the attachment viewer and pipe command): #!/bin/bash
TERMINAL=evilvte
CONFIG=~/.gcalclirc
$TERMINAL -e bash -c "echo 'Importing invite...' ; \
gcalcli --detail-url=short \
--calendar='Eric Davis' \
import -v \"$1\" ; \
read -p 'press enter to exit: '" Note that with Thunderbird you'll have to have the 'Show All Body Parts' extension installed for seeing the calendar attachments when not using 'Lightning'. See this bug report for more details. Event Popup RemindersThe 'remind' command for gcalcli is used to execute any command as an event notification. This can be a notify-send or an xmessage-like popup or whatever else you can think of. gcalcli does not contain a daemon so you'll have to use some other tool to ensure gcalcli is run in a timely manner for notifications. Two options are using cron or a loop inside a shell script. Cron: % crontab -l
*/10 * * * * /usr/bin/gcalcli remind Shell script like your .xinitrc so notifications only occur when you're logged in via X: #!/bin/bash
[[ -x /usr/bin/dunst ]] && /usr/bin/dunst -config ~/.dunstrc &
if [ -x /usr/bin/gcalcli ]; then
while true; do
/usr/bin/gcalcli --calendar="davis" remind
sleep 300
done &
fi
exec herbstluftwm # :-) By default gcalcli executes the notify-send command for notifications. Most common Linux desktop enviroments already contain a DBUS notification daemon that supports libnotify so it should automagically just work. If you're like me and use nothing that is common I highly recommend the dunst dmenu'ish notification daemon. Note that each time you run this you will get a reminder if you're still inside the event duration. Also note that due to time slip between machines, gcalcli will give you a ~5 minute margin of error. Plan your cron jobs accordingly. Agenda On Your Root DesktopPut your agenda on your desktop using Conky. The '--conky' option causes gcalcli to output Conky color sequences. Note that you need to use the Conky 'execpi' command for the gcalcli output to be parsed for color sequences. Add the following to your .conkyrc:
To also get a graphical calendar that shows the next three weeks add:
You may need to increase the Additionaly you need to set
Agenda Integration With tmuxPut your next event in the left of your 'tmux' status line. Add the following to your tmux.conf file:
Agenda Integration With screenPut your next event in your 'screen' hardstatus line. First add a cron job that will dump you agenda to a text file:
Then add the following line:
Next create a simple shell script that will extract the first agenda line. Let's call this script 'screen_agenda':
Next configure screen's hardstatus line to gather data from a backtick command. Of course your hardstatus line is most likely very different than this (Mine is!):
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论