Skip to content

Commit

Permalink
fix currdir, import depency
Browse files Browse the repository at this point in the history
  • Loading branch information
aliorhun committed Jul 27, 2020
1 parent b1de8a4 commit e50d396
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
30 changes: 30 additions & 0 deletions build_debpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

mkdir -p packages/DEBIAN
mkdir -p packages/usr/local/bin/
mkdir -p packages/usr/share/hvl/projectx/

echo """#!/bin/bash
python3 /usr/share/hvl/projectx/src/tray.py""" > packages/usr/local/bin/projectx
cp -r images locale src apps.gsettings-projectx.gschema.xml packages/usr/share/hvl/projectx
mkdir -p packages/usr/share/hvl/projectx/logs
size=$(du -s ./ | cut -f 1)
version=$(date +'%Y%m%d-%H%M%S')
date=$(date +'%d/%m/%Y-%H:%M:%S')
echo """Package: projectx
Version: $version
Installed-Size: $size
Maintainer: Ridvan Tulemen <ridvantulemen@gmail.com>
Date : $date
Depends: python3-pil, python3-gi, graphicsmagick-imagemagick-compat
Architecture: amd64
Description: Projectx
""" > packages/DEBIAN/control

find ./ -type f ! -regex '.*?DEBIAN.*' -exec md5sum {} \; > packages/DEBIAN/md5sums
echo """chmod +x /usr/local/bin/projectx
cp /usr/share/hvl/projectx/apps.gsettings-projectx.gschema.xml /usr/share/glib-2.0/schemas/
glib-compile-schemas /usr/share/glib-2.0/schemas/""" > packages/DEBIAN/postinst
chmod +x packages/DEBIAN/postinst
version=$(date +'%Y%m%d-%H%M%S')
dpkg-deb -Zgzip --build ./packages projectx_$version.deb
2 changes: 1 addition & 1 deletion src/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

CURRDIR = os.path.dirname(os.path.abspath(__file__))
# this maindir is for development, the commented one is for release
MAINDIR = "./" #"/usr/share/hvl/projectx/"
MAINDIR = "/usr/share/hvl/projectx/"
ICONDomain = os.path.join(MAINDIR+"images/", 'Domain-icon.png')
ICONLocal = os.path.join(MAINDIR+"images/", 'Local-icon.png')

Expand Down
8 changes: 4 additions & 4 deletions src/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GdkPixbuf, GLib

from PIL import Image, ImageGrab
from PIL import Image

import send, message, summary, controls, notifications
import subprocess, gettext, sys
import subprocess, gettext, sys, os

el = gettext.translation('base', 'locale', fallback=True)
el.install()
Expand Down Expand Up @@ -71,8 +71,8 @@ def on_controls_click(self, button):

def on_send_click(self, button):
try:
image = ImageGrab.grab()
image.save(summary.MAINDIR + 'image.jpg')
imagename = summary.MAINDIR + 'image.jpg'
os.system("import -window root "+imagename)

self.send_window = send.Window()
self.send_window.show_popup_window()
Expand Down

0 comments on commit e50d396

Please sign in to comment.