diff --git a/dpkg/DEBIAN/control b/dpkg/DEBIAN/control new file mode 100644 index 0000000..1508a2b --- /dev/null +++ b/dpkg/DEBIAN/control @@ -0,0 +1,8 @@ +Package: sweecrypt-gtk +Version: 1.0 +Section: utils +Priority: optional +Architecture: all +Maintainer: Swee +Description: A GUI for the SweeCrypt cipher. +Depends: python3 | python3-gi | python3-gi-cairo | python3-sweecrypt | gir1.2-gtk-3.0 diff --git a/dpkg/opt/sweecrypt-gtk.ui b/dpkg/opt/sweecrypt-gtk.ui new file mode 100644 index 0000000..7008c30 --- /dev/null +++ b/dpkg/opt/sweecrypt-gtk.ui @@ -0,0 +1,96 @@ + + + + + + True + False + edit-copy + + + True + False + document-revert + + + True + False + document-properties + + + replace this text with anything +you want to encode or decode. + + + False + SweeCrypt GTK + sweecrypt + + + + True + False + vertical + + + True + True + text + True + + + True + True + 0 + + + + + Encode + True + True + True + image1 + True + + + + False + True + 1 + + + + + Decode + True + True + True + image2 + + + + False + True + 2 + + + + + Start + True + True + True + start + + + + False + True + 4 + + + + + + diff --git a/dpkg/usr/bin/sweecrypt-gtk b/dpkg/usr/bin/sweecrypt-gtk new file mode 100644 index 0000000..6b5243b --- /dev/null +++ b/dpkg/usr/bin/sweecrypt-gtk @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +import gi, os, sys, sweecrypt as sc +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk, GdkPixbuf, Gdk +UI_FILE = "/opt/sweecrypt-gtk.ui" +class GUI: + def __init__(self): + self.builder = Gtk.Builder() + self.builder.add_from_file(UI_FILE) + self.builder.connect_signals(self) + window = self.builder.get_object('window') + window.show_all() + def toggle(self, e:bool): + if e: + active = self.builder.get_object('encode').get_property("active") + self.builder.get_object('decode').set_property("active", not active) + else: + active = self.builder.get_object('decode').get_property("active") + self.builder.get_object('encode').set_property("active", not active) + def on_window_destroy(self, window):Gtk.main_quit() + def encode_toggle(self, encode):self.toggle(True) + def decode_toggle(self, decode):self.toggle(False) + def start_clicked(self, start): + encode = self.builder.get_object('encode').get_property("active") + inputted = self.builder.get_object('text').get_property("text") + if encode: + self.builder.get_object('text').set_property("text", sc.encrypt(inputted)) + self.builder.get_object('encode').set_property("active", False) + else: + self.builder.get_object('text').set_property("text", sc.decrypt(inputted)) + self.builder.get_object('decode').set_property("active", False) +def main(): + app = GUI() + Gtk.main() +if __name__ == "__main__": + sys.exit(main()) diff --git a/dpkg/usr/share/applications/sweecrypt-gtk.desktop b/dpkg/usr/share/applications/sweecrypt-gtk.desktop new file mode 100644 index 0000000..c1d9511 --- /dev/null +++ b/dpkg/usr/share/applications/sweecrypt-gtk.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=SweeCrypt GTK +Comment=Simple and fun cipher +Exec=sweecrypt-gtk +Type=Application +Icon=sweecrypt +Categories=Utility; +StartupNotify=false