Compare commits

...

2 Commits

5 changed files with 45 additions and 2 deletions

View File

@ -1,4 +1,14 @@
#!/bin/sh
cd ~/Downloads
YTDL_WD=$(zenity --file-selection --directory --filename=.)
xfce4-terminal --default-working-directory $YTDL_WD --execute youtube-dl $@
YTDL_WD="."
if [ $(command -v zenity) ]; then
YTDL_WD=$(zenity --file-selection --directory --filename=.)
fi
if [ $(command -v xfce4-terminal) ]; then
xfce4-terminal --default-working-directory "$YTDL_WD" --execute youtube-dl $@
else
cd "$YTDL_WD"
youtube-dl $@
fi

8
sms/clear_sms Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env python3
from sms import get_sms
from subprocess import call
from os.path import basename
for sms in get_sms():
print(sms)
call(["mmcli", "-m", "any", "--messaging-delete-sms", sms[0]])

10
sms/dump_sms Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
from sms import get_sms
from subprocess import call
from os.path import basename
for sms in get_sms():
print(sms)
out_file = "{}.{}.sms".format(basename(sms[0]), sms[1])
print(">> dump to {}".format(out_file))
call(["mmcli", "-m", "any", "--create-file-with-data", out_file, "--sms", sms[0]])

4
sms/list_sms Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env python3
from sms import get_sms
for sms in get_sms():
print(sms)

11
sms/sms.py Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
from subprocess import call, check_output
from os.path import basename
def parse_list_item(item):
item = item.strip().split(" ", 2)
item[1] = item[1][1:-1]
return tuple(item)
def get_sms():
return [parse_list_item(sms) for sms in check_output(["mmcli", "-m", "any", "--messaging-list-sms"]).decode().strip().split("\n")]