/usr/bin/um-url is in unity-mail 0.92.2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Unity Mail, QuickList URL processor
# Author: Dmitry Shachnev <mitya57@gmail.com>
# License: GNU GPL 3 or higher; http://www.gnu.org/licenses/gpl.html
import os.path
import sys
import webbrowser
from configparser import RawConfigParser
from subprocess import Popen
CONFIG_DIR = os.path.expanduser('~/.config/')
if not os.path.exists(CONFIG_DIR+'autostart/unity-mail-autostart.desktop'):
# First run of Unity Mail, open um-config
Popen('um-config')
sys.exit()
parser = RawConfigParser()
parser.read(CONFIG_DIR+'unity-mail.conf')
default = \
{ 'Home': 'https://mail.google.com/mail/',
'Compose': 'https://mail.google.com/mail/#compose',
'Inbox': 'https://mail.google.com/mail/#inbox',
'Sent': 'https://mail.google.com/mail/#sent' }
def print_names():
print('Possible URL names: "Home", "Compose", "Inbox", "Sent"')
if len(sys.argv) > 1:
name = sys.argv[1]
if parser.has_option('URLs', name):
url = parser.get('URLs', name)
if url.startswith('Exec:'):
Popen(url[5:].split(' '))
else:
webbrowser.open(url)
else:
try:
webbrowser.open(default[name])
except KeyError:
print('Error: unknown URL name!')
print_names()
else:
print('Error: please specify URL name.')
print_names()
|