diff --git a/bin/gwinwrap-0-0-1-x64.deb b/bin/gwinwrap-0-0-1-x64.deb index ce5c0d1..952079b 100644 Binary files a/bin/gwinwrap-0-0-1-x64.deb and b/bin/gwinwrap-0-0-1-x64.deb differ diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/GWinWrap.py b/src/GWinWrap/GWinWrap.py similarity index 94% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/GWinWrap.py rename to src/GWinWrap/GWinWrap.py index cf62815..e9a0ce6 100755 --- a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/GWinWrap.py +++ b/src/GWinWrap/GWinWrap.py @@ -5,7 +5,12 @@ import os, cairo, sys, gi, re, threading, subprocess, hashlib, signal, time gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') -from gi.repository import Gtk as gtk, Gdk as gdk, GObject as gobject, GdkPixbuf +from gi.repository import Gtk as gtk +from gi.repository import Gdk as gdk +from gi.repository import GObject as gobject +from gi.repository import GdkPixbuf +from gi.repository import GLib + from os import listdir from os.path import isfile, join @@ -28,8 +33,7 @@ class GWinWrap: window = self.builder.get_object("Main") monitors = self.setWindowData(window) window.connect("delete-event", gtk.main_quit) - - print(monitors[1]) + GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, gtk.main_quit) # Add filter to allow only folders to be selected dialog = self.builder.get_object("selectedDirDialog") @@ -98,6 +102,7 @@ class GWinWrap: cr.set_operator(cairo.OPERATOR_OVER) def getMonitorData(self, screen): + posOff = self.builder.get_object("posOffset") monitors = [] wxhxny = [] @@ -108,6 +113,16 @@ class GWinWrap: for monitor in monitors: wxhxny.append(str(monitor.width) + "x" + str(monitor.height) + "+" + str(monitor.x) + "+" + str(monitor.y)) + if monitor.x >= 0 and monitor.y >= 0: + posOff.append_text("+" + str(monitor.x) + "+" + str(monitor.y)) + elif monitor.x <= 0 and monitor.y <= 0: + posOff.append_text(str(monitor.x) + str(monitor.y)) + elif monitor.x >= 0 and monitor.y <= 0: + posOff.append_text("+" + str(monitor.x) + str(monitor.y)) + elif monitor.x <= 0 and monitor.y >= 0: + posOff.append_text(str(monitor.x) + "+" + str(monitor.y)) + + posOff.set_active(0) return wxhxny diff --git a/src/GWinWrap/GWinWrap.sh b/src/GWinWrap/GWinWrap.sh new file mode 100755 index 0000000..6ef2628 --- /dev/null +++ b/src/GWinWrap/GWinWrap.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# set -o xtrace ## To debug scripts +# set -o errexit ## To exit on error +# set -o errunset ## To exit if a variable is referenced but not set + + +function main() { + # GTK_DEBUG=interactive python3 ./GWinWrap.py + python3 ./GWinWrap.py +} +main $@; diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/GWinWrap.glade b/src/GWinWrap/resources/GWinWrap.glade similarity index 93% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/GWinWrap.glade rename to src/GWinWrap/resources/GWinWrap.glade index 5ec4874..1864a66 100644 --- a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/GWinWrap.glade +++ b/src/GWinWrap/resources/GWinWrap.glade @@ -387,46 +387,6 @@ True False - 18 - - Left - -7680+0 - -3840+0 - -2048+0 - -1920+0 - -1440+0 - -1600+0 - -1280+0 - -800+0 - Right - +7680+0 - +3840+0 - +2048+0 - +1920+0 - +1440+0 - +1600+0 - +1280+0 - +800+0 - +0+0 - Top - +0+7680 - +0+3840 - +0+2048 - +0+1920 - +0+1440 - +0+1600 - 0+1280 - +0+800 - Bottum - +0-7680 - +0-3840 - +0-2048 - +0-1920 - +0-1440 - +0-1600 - 0-1280 - +0-800 - True diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/GWinWrap.png b/src/GWinWrap/resources/icons/GWinWrap.png similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/GWinWrap.png rename to src/GWinWrap/resources/icons/GWinWrap.png diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/folder.png b/src/GWinWrap/resources/icons/folder.png similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/folder.png rename to src/GWinWrap/resources/icons/folder.png diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/picture.png b/src/GWinWrap/resources/icons/picture.png similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/picture.png rename to src/GWinWrap/resources/icons/picture.png diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/player.png b/src/GWinWrap/resources/icons/player.png similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/icons/player.png rename to src/GWinWrap/resources/icons/player.png diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/stylesheet.css b/src/GWinWrap/resources/stylesheet.css similarity index 83% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/stylesheet.css rename to src/GWinWrap/resources/stylesheet.css index b1a267d..722921b 100644 --- a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/resources/stylesheet.css +++ b/src/GWinWrap/resources/stylesheet.css @@ -1,3 +1,3 @@ window { -} \ No newline at end of file +} diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/SaveGWinWrapSettings.py b/src/GWinWrap/utils/SaveGWinWrapSettings.py similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/SaveGWinWrapSettings.py rename to src/GWinWrap/utils/SaveGWinWrapSettings.py diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/SaveStateToXWinWarp.py b/src/GWinWrap/utils/SaveStateToXWinWarp.py similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/SaveStateToXWinWarp.py rename to src/GWinWrap/utils/SaveStateToXWinWarp.py diff --git a/src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/__init__.py b/src/GWinWrap/utils/__init__.py similarity index 100% rename from src/debs/gwinwrap-0-0-1-x64/opt/GWinWrap/utils/__init__.py rename to src/GWinWrap/utils/__init__.py diff --git a/src/versions/0.0.1/XWinWrap/Makefile b/src/XWinWrap/Makefile similarity index 100% rename from src/versions/0.0.1/XWinWrap/Makefile rename to src/XWinWrap/Makefile diff --git a/src/versions/0.0.1/XWinWrap/xwinwrap.c b/src/XWinWrap/xwinwrap.c similarity index 100% rename from src/versions/0.0.1/XWinWrap/xwinwrap.c rename to src/XWinWrap/xwinwrap.c diff --git a/src/versions/0.0.1/compileBin.sh b/src/compileBin.sh similarity index 100% rename from src/versions/0.0.1/compileBin.sh rename to src/compileBin.sh diff --git a/src/debs/build.sh b/src/debs/build.sh deleted file mode 100644 index bb0b522..0000000 --- a/src/debs/build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# Fixes ownershp -function main() { - sudo find . -type f -exec chmod 644 {} + - sudo find . -type d -exec chmod 755 {} + - - # Set postrm permissions - for i in `find . -name postrm`; do - sudo chmod 755 "${i}" - done - - # Set gwinwrap permissions - for i in `find . -name gwinwrap`; do - sudo chmod 755 "${i}" - done - - # Set xwinwrap permissions - for i in `find . -name xwinwrap`; do - sudo chmod 755 "${i}" - done - - sudo chown -R root:root ./*/ - - builder; - bash ./chownAll.sh -} - -#builds debs -function builder() { - for i in `ls`; do - if [[ -d "${i}" ]]; then - dpkg --build "${i}" - else - echo "Not a dir." - fi - done -} -main; diff --git a/src/debs/chownAll.sh b/src/debs/chownAll.sh deleted file mode 100644 index 44bef62..0000000 --- a/src/debs/chownAll.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -function main() { - sudo chown -R abaddon:abaddon . -} -main; diff --git a/src/debs/gwinwrap-0-0-1-x64/DEBIAN/control b/src/debs/gwinwrap-0-0-1-x64/DEBIAN/control deleted file mode 100644 index a23c389..0000000 --- a/src/debs/gwinwrap-0-0-1-x64/DEBIAN/control +++ /dev/null @@ -1,8 +0,0 @@ -Package: gwinwrap64 -Version: 0.0-1 -Section: python -Priority: optional -Architecture: amd64 -Depends: ffmpegthumbnailer (>= 2.0.10-0.1), mplayer (>=2.0-728-g2c378c7-4), gifsicle (>=1.86-1), nitrogen (>=1.5.2-2), xscreensaver (>=5.36-1ubuntu1), xscreensaver-gl (>=5.36-1ubuntu1), xscreensaver-gl-extra (>=5.36-1ubuntu1), xscreensaver-screensaver-dizzy (>=0.3-3), xscreensaver-screensaver-bsod (>=5.36-1ubuntu1), xscreensaver-data (>=5.36-1ubuntu1), xscreensaver-data-extra (>=5.36-1ubuntu1), xscreensaver-screensaver-webcollage (>=5.36-1ubuntu1) -Maintainer: Maxim Stewart <1itdominator@gmail.com> -Description: GWinWrap is a GUI to handle setting XWinWrap options. diff --git a/src/debs/gwinwrap-0-0-1-x64/DEBIAN/postrm b/src/debs/gwinwrap-0-0-1-x64/DEBIAN/postrm deleted file mode 100755 index c65bdd9..0000000 --- a/src/debs/gwinwrap-0-0-1-x64/DEBIAN/postrm +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -#postrm (script executed after uninstalling the package) -#set -e - -if [ -f /bin/xwinwrap ]; then - rm /bin/xwinwrap -fi - -if [ -f /bin/gwinwrap ]; then - rm /bin/gwinwrap -fi - -if [ -d /opt/GWinWrap ]; then - rm -rf /opt/GWinWrap -fi - -if [ -x "`which xdg-desktop-menu 2>/dev/null`" ]; then - xdg-desktop-menu uninstall /usr/share/applications/GWinWrap.desktop - xdg-desktop-menu forceupdate --mode user -fi diff --git a/src/debs/gwinwrap-0-0-1-x64/bin/gwinwrap b/src/debs/gwinwrap-0-0-1-x64/bin/gwinwrap deleted file mode 100755 index fe880e0..0000000 Binary files a/src/debs/gwinwrap-0-0-1-x64/bin/gwinwrap and /dev/null differ diff --git a/src/debs/gwinwrap-0-0-1-x64/bin/xwinwrap b/src/debs/gwinwrap-0-0-1-x64/bin/xwinwrap deleted file mode 100755 index 26eafd7..0000000 Binary files a/src/debs/gwinwrap-0-0-1-x64/bin/xwinwrap and /dev/null differ diff --git a/src/debs/gwinwrap-0-0-1-x64/usr/share/applications/GWinWrap.desktop b/src/debs/gwinwrap-0-0-1-x64/usr/share/applications/GWinWrap.desktop deleted file mode 100644 index 157de6e..0000000 --- a/src/debs/gwinwrap-0-0-1-x64/usr/share/applications/GWinWrap.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=GWinWrap -Comment=Glade gui with python controls for XWinWrap -Exec=/bin/gwinwrap -Icon=/opt/GWinWrap/resources/icons/GWinWrap.png -Terminal=false -Type=Application -Categories=System; diff --git a/src/debs/gwinwrap-0-0-1-x64/usr/share/doc/gwinwrap/copyright b/src/debs/gwinwrap-0-0-1-x64/usr/share/doc/gwinwrap/copyright deleted file mode 100644 index 53b78e8..0000000 --- a/src/debs/gwinwrap-0-0-1-x64/usr/share/doc/gwinwrap/copyright +++ /dev/null @@ -1,22 +0,0 @@ -GWinWrap is copyright 2016, 2017 Maxim Stewart. -GWinWrap is currently developed by ITDominator <1itdominator@gmail.com>. - -License: GPLv2+ - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -See /usr/share/common-licenses/GPL-2, or - for the terms of the latest version -of the GNU General Public License. diff --git a/src/versions/0.0.1/gwinwrap_exec_bin.cpp b/src/gwinwrap_exec_bin.cpp similarity index 100% rename from src/versions/0.0.1/gwinwrap_exec_bin.cpp rename to src/gwinwrap_exec_bin.cpp diff --git a/src/versions/0.0.1/GWinWrap/GWinWrap.py b/src/versions/0.0.1/GWinWrap/GWinWrap.py deleted file mode 100755 index cf62815..0000000 --- a/src/versions/0.0.1/GWinWrap/GWinWrap.py +++ /dev/null @@ -1,380 +0,0 @@ -#!/usr/bin/env python - -import os, cairo, sys, gi, re, threading, subprocess, hashlib, signal, time - -gi.require_version('Gtk', '3.0') -gi.require_version('Gdk', '3.0') - -from gi.repository import Gtk as gtk, Gdk as gdk, GObject as gobject, GdkPixbuf - -from os import listdir -from os.path import isfile, join -from threading import Thread - -from utils import SaveStateToXWinWarp, SaveGWinWrapSettings - -gdk.threads_init() - - -class GWinWrap: - def __init__(self): - self.builder = gtk.Builder() - self.builder.add_from_file("resources/GWinWrap.glade") - self.builder.connect_signals(self) - - # Get window and connect signals - self.stateSaver = SaveStateToXWinWarp() - self.sttngsSver = SaveGWinWrapSettings() - window = self.builder.get_object("Main") - monitors = self.setWindowData(window) - window.connect("delete-event", gtk.main_quit) - - print(monitors[1]) - - # Add filter to allow only folders to be selected - dialog = self.builder.get_object("selectedDirDialog") - filefilter = self.builder.get_object("Folders") - dialog.add_filter(filefilter) - - # Get reference to remove and add it back... - self.gridLabel = self.builder.get_object("gridLabel") - - self.focusedImg = gtk.Image() - self.usrHome = os.path.expanduser('~') - self.xScreenVal = None - self.toSavePath = None # Global file path and type for saving to file - self.applyType = 1 # 1 is XWinWrap and 2 is Nitrogen - - self.loadProgress = self.builder.get_object("loadProgress") - self.helpLabel = self.builder.get_object("helpLabel") - self.defaultLabel = "Note: Double click an image to view the video or image." - self.savedLabel = "Saved settings..." - self.appliedLabel = "Running xwinwrap..." - self.stoppedLabel = "Stopped xwinwrap..." - # foreground=\"#ffa800\" - # foreground=\"#88cc27\" - # foreground=\"#ff0000\" - - # Fill list xscreensaver - self.xscrPth = "/usr/lib/xscreensaver/" - xscreenList = self.builder.get_object("XScreensaver List") - list = [f for f in listdir(self.xscrPth) if isfile(join(self.xscrPth, f))] - list.sort() - - for file in list: - xscreenList.append((file,)) - - self.selectedImg = None # EventBox holder - self.defPath = None - self.player = None - self.imgVwr = None - self.demoAreaPid = None - - self.retrieveSettings() - window.show() - - def setWindowData(self, window): - screen = window.get_screen() - visual = screen.get_rgba_visual() - if visual != None and screen.is_composited(): - window.set_visual(visual) - - window.set_app_paintable(True) - window.connect("draw", self.area_draw) - - # bind css file - cssProvider = gtk.CssProvider() - cssProvider.load_from_path('resources/stylesheet.css') - screen = gdk.Screen.get_default() - styleContext = gtk.StyleContext() - styleContext.add_provider_for_screen(screen, cssProvider, gtk.STYLE_PROVIDER_PRIORITY_USER) - - return self.getMonitorData(screen) - - def area_draw(self, widget, cr): - cr.set_source_rgba(0, 0, 0, 0.64) - cr.set_operator(cairo.OPERATOR_SOURCE) - cr.paint() - cr.set_operator(cairo.OPERATOR_OVER) - - def getMonitorData(self, screen): - monitors = [] - wxhxny = [] - - for m in range(screen.get_n_monitors()): - monitors.append(screen.get_monitor_geometry(m)) - - wxhxny.append(monitors) - for monitor in monitors: - wxhxny.append(str(monitor.width) + "x" + str(monitor.height) + "+" + str(monitor.x) + "+" + str(monitor.y)) - - return wxhxny - - - def setNewDir(self, widget, data=None): - dir = widget.get_filename() - Thread(target=self.newDir, args=(dir,)).start() - - def newDir(self, dir): - imageGrid = self.builder.get_object("imageGrid") - dirPath = dir - list = [f for f in listdir(dirPath) if isfile(join(dirPath, f))] - files = [] - row = 0 - col = 0 - - for file in list: - if file.lower().endswith(('.mkv', '.avi', '.flv', '.mov', '.m4v', '.mpg', '.wmv', '.mpeg', '.mp4', '.webm', '.png', '.jpg', '.jpeg', '.gif')): - files.append(file) - - fractionTick = 1.0 / 1.0 if len(files) == 0 else len(files) - tickCount = 0.0 - self.clear() - imageGrid.remove_column(0) - self.loadProgress.set_text("Loading...") - self.loadProgress.set_fraction(0.0) - self.helpLabel.set_markup("" + dirPath.strip(self.usrHome) + "") - for file in files: - fullPathFile = dirPath + "/" + file - eveBox = gtk.EventBox() - thumbnl = gtk.Image() - - if file.lower().endswith(('.mkv', '.avi', '.flv', '.mov', '.m4v', '.mpg', '.wmv', '.mpeg', '.mp4', '.webm')): - fileHash = hashlib.sha256(str.encode(fullPathFile)).hexdigest() - hashImgpth = self.usrHome + "/.thumbnails/normal/" + fileHash + ".png" - if isfile(hashImgpth) == False: - self.generateThumbnail(fullPathFile, hashImgpth) - - thumbnl = self.createGtkImage(hashImgpth, [310, 310]) - eveBox.connect("button_press_event", self.runMplayerProcess, (fullPathFile, file, eveBox,)) - eveBox.connect("enter_notify_event", self.mouseOver, ()) - eveBox.connect("leave_notify_event", self.mouseOut, ()) - elif file.lower().endswith(('.png', '.jpg', '.jpeg', '.gif')): - thumbnl = self.createGtkImage(fullPathFile, [310, 310]) - eveBox.connect("button_press_event", self.runImageViewerProcess, (fullPathFile, file, eveBox,)) - eveBox.connect("enter_notify_event", self.mouseOver, ()) - eveBox.connect("leave_notify_event", self.mouseOut, ()) - else: - print("Not a video or image file.") - return - - gobject.idle_add(self.preGridSetup, (eveBox, thumbnl, )) - gobject.idle_add(self.addToGrid, (imageGrid, eveBox, col, row,)) - tickCount = tickCount + fractionTick - self.loadProgress.set_fraction(tickCount) - - col += 1 - if col == 2: - col = 0 - row += 1 - - self.loadProgress.set_text("Finished...") - - def preGridSetup(self, args): - args[0].show() - args[1].show() - args[0].add(args[1]) - - def addToGrid(self, args): - args[0].attach(args[1], args[2], args[3], 1, 1) - - def generateThumbnail(self, fullPathFile, hashImgpth): - subprocess.call(["ffmpegthumbnailer", "-t", "65%", "-s", "300", "-c", "jpg", "-i", fullPathFile, "-o", hashImgpth]) - - def createGtkImage(self, path, wxh): - try: - pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( - filename = path, - width = wxh[0], - height = wxh[1], - preserve_aspect_ratio = True) - return gtk.Image.new_from_pixbuf(pixbuf) - except Exception as e: - print(e) - - return gtk.Image() - - - def openMainImageViewer(self, widget): - subprocess.call([self.imgVwr, self.toSavePath]) - - def runImageViewerProcess(self, widget, eve, params): - self.setSelected(params[2]) - - if eve.type == gdk.EventType.DOUBLE_BUTTON_PRESS: - previewWindow = self.builder.get_object("previewWindow") - previewImg = self.builder.get_object("previewImg") - previewImg.set_from_file(params[0]) - previewWindow.show_all() - previewWindow.popup() - - self.toSavePath = params[0] - self.applyType = 2 - self.helpLabel.set_markup("" + params[1] + "") - - def setSelected(self, eveBox): - if self.selectedImg: - col = gdk.RGBA(0.0, 0.0, 0.0, 0.0) - self.selectedImg.override_background_color(gtk.StateType.NORMAL, col) - - col = gdk.RGBA(0.9, 0.7, 0.4, 0.74) - eveBox.override_background_color(gtk.StateType.NORMAL, col) - self.selectedImg = eveBox - - def closePopup(self, widget): - self.builder.get_object("previewWindow").popdown() - - def mouseOver(self, widget, eve, args): - hand_cursor = gdk.Cursor(gdk.CursorType.HAND2) - self.builder.get_object("Main").get_window().set_cursor(hand_cursor) - - def mouseOut(self, widget, eve, args): - watch_cursor = gdk.Cursor(gdk.CursorType.LEFT_PTR) - self.builder.get_object("Main").get_window().set_cursor(watch_cursor) - - def toggleXscreenUsageField(self, widget, data=None): - useXscreenSaver = self.builder.get_object("useXScrnList") - if useXscreenSaver.get_active(): - self.builder.get_object("xScreenSvrList").set_sensitive(True) - else: - self.builder.get_object("xScreenSvrList").set_sensitive(False) - - def popSttingsWindow(self, widget): - self.builder.get_object("settingsWindow").popup() - - def saveToSettingsFile(self, widget): - self.defPath = self.builder.get_object("customDefaultPath").get_text().strip() - self.player = self.builder.get_object("customVideoPlyr").get_text().strip() - self.imgVwr = self.builder.get_object("customImgVwr").get_text().strip() - - self.sttngsSver.saveSettings(self.defPath, self.player, self.imgVwr) - - def retrieveSettings(self): - data = self.sttngsSver.retrieveSettings() - self.defPath = data[0] - self.player = data[1] - self.imgVwr = data[2] - - self.builder.get_object("customDefaultPath").set_text(self.defPath) - self.builder.get_object("customVideoPlyr").set_text(self.player) - self.builder.get_object("customImgVwr").set_text(self.imgVwr) - self.builder.get_object("selectedDirDialog").set_filename(self.defPath) - - def saveToFile(self, widget, data=None): - saveLoc = self.builder.get_object("saveLoc").get_active_text() - useXscreenSaver = self.builder.get_object("useXScrnList").get_active() - plyBckRes = self.builder.get_object("playbackResolution") - offset4Res = self.builder.get_object("posOffset") - resolution = plyBckRes.get_active_text() + offset4Res.get_active_text() - self.applyType = self.stateSaver.saveToFile(self.toSavePath, resolution, - saveLoc, useXscreenSaver, self.xScreenVal) - if self.applyType == -1: - self.helpLabel.set_markup("Nothing saved...") - return - - self.helpLabel.set_markup(self.savedLabel) - - def applySttngs(self, widget, data=None): - os.system("killall xwinwrap &") - if self.applyType == 1: - os.system("bash -c '~/.animatedBGstarter.sh' &") - os.system("bash -c '~/.animatedBGstarter2.sh' &") - elif self.applyType == 2: - os.system("nitrogen --restore &") - else: - os.system("nitrogen --restore &") - self.helpLabel.set_markup(self.appliedLabel) - - def killXWinWrp(self, widget, data=None): - os.system("killall xwinwrap &") - self.helpLabel.set_markup(self.stoppedLabel) - - def passXScreenVal(self, widget): - xSvrListStore = self.builder.get_object("XScreensaver List") - row = widget.get_cursor() - path = gtk.TreePath(row.path) - treeiter = xSvrListStore.get_iter(path[0]) - self.xScreenVal = xSvrListStore.get_value(treeiter, 0) - - - def runMplayerProcess(self, widget, eve, params): - self.setSelected(params[2]) - video = params[0] - - if eve.type == gdk.EventType.DOUBLE_BUTTON_PRESS: - if self.player == "mplayer": - xid = self.getXID() - command = [self.player, video, "-slave", "-wid", str(xid), "-really-quiet", "-ao", "null", "-loop", "0"] - self.runDemoToDrawArea(command) - else: - subprocess.call([self.player, video, "-really-quiet", "-ao", "null", "-loop", "0"]) - - self.toSavePath = params[0] - self.applyType = 1 - self.helpLabel.set_markup("" + params[1] + "") - - def previewXscreen(self, widget, eve): - if eve.type == gdk.EventType.DOUBLE_BUTTON_PRESS: - demoXscrnSaver = self.xscrPth + self.xScreenVal - xid = self.getXID() - command = [demoXscrnSaver, "-window-id", str(xid)] - self.runDemoToDrawArea(command) - - def getXID(self): - # Must be actualized before getting window - demoWindowPopup = self.builder.get_object("demoPreviewPopWindow") - - if demoWindowPopup.get_visible() == False: - demoWindowPopup.show_all() - demoWindowPopup.popup() - - demoPreview = self.builder.get_object("demoPreview") - drwWindow = demoPreview.get_window() - return drwWindow.get_xid() - - def runDemoToDrawArea(self, command): - self.helpLabel.set_markup("") - - if self.demoAreaPid: - os.kill(self.demoAreaPid, signal.SIGTERM) #or signal.SIGKILL - self.demoAreaPid = None - - time.sleep(.800) # 800 mili-seconds to ensure first process dead - process = subprocess.Popen(command) - self.demoAreaPid = process.pid - - def closeDemoWindow(self, widget, data=None): - self.builder.get_object("demoPreviewPopWindow").popdown() - os.kill(self.demoAreaPid, signal.SIGTERM) #or signal.SIGKILL - self.demoAreaPid = None - - def clearSelection(self, widget, data=None): - self.clear() - - def clear(self): - imageGrid = self.builder.get_object("imageGrid") - - while True: - if imageGrid.get_child_at(0,0)!= None: - imageGrid.remove_row(0) - else: - break - - imageGrid.attach(self.gridLabel, 0, 0, 1, 1) - self.builder.get_object("xScreenSvrList").set_sensitive(False) - self.builder.get_object("useXScrnList").set_active(False) - self.helpLabel.set_markup(self.defaultLabel) - self.loadProgress.set_text("") - self.loadProgress.set_fraction(0.0) - self.toSavePath = None - self.xScreenVal = None - self.applyType = 1 # Default to XWinWrap - - def closeProgram(self, widget, data=None): - sys.exit(0) - - - -if __name__ == "__main__": - main = GWinWrap() - gtk.main() diff --git a/src/versions/0.0.1/GWinWrap/resources/GWinWrap.glade b/src/versions/0.0.1/GWinWrap/resources/GWinWrap.glade deleted file mode 100644 index 5ec4874..0000000 --- a/src/versions/0.0.1/GWinWrap/resources/GWinWrap.glade +++ /dev/null @@ -1,883 +0,0 @@ - - - - - - - inode/directory - - - - - - - - - - True - False - gtk-clear - 3 - - - True - False - gtk-quit - 3 - - - True - False - gtk-cancel - 3 - - - True - False - gtk-jump-to - 3 - - - True - False - gtk-save - 3 - - - True - False - gtk-save - 3 - - - True - False - Settings.... - gtk-properties - 3 - - - True - False - gtk-media-play - 3 - - - True - False - gtk-media-stop - 3 - - - 950 - 600 - False - GWinWrap - center - 950 - 600 - icons/GWinWrap.png - center - - - - - - True - False - - - True - False - 15 - 15 - 15 - vertical - - - True - False - 5 - - - True - False - 15 - Note: Double click an image to view the video or image. - - - True - True - 0 - - - - - True - False - Chose Dream Scene / Image Directory - select-folder - False - Folders - Dream Scene / Image Dir - - - - False - True - 1 - - - - - True - True - True - settingsImage - True - - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - True - - - False - True - 1 - - - - - True - True - in - - - True - False - - - True - False - vertical - 10 - 10 - True - True - - - 640 - 525 - True - False - Choose Image/Video Directory... - - - - - - 0 - 0 - - - - - - - - - True - True - 2 - - - - - Clear - True - True - True - clearImage - True - - - - False - True - 3 - - - - - True - True - 0 - - - - - 300 - True - False - 10 - 15 - 15 - 15 - False - vertical - - - True - False - vertical - - - Use XScreenSaver - True - True - False - center - 5 - True - - - - False - True - 0 - - - - - True - True - in - - - True - False - True - XScreensaver List - False - - - - - - - - XScreensaves - - - - 0 - - - - - - - - - True - True - 1 - - - - - True - True - 0 - - - - - True - False - False - vertical - - - True - False - vertical - - - True - False - - - True - False - 10 - 10 - Playback Resolutions - - - True - True - 0 - - - - - True - False - 10 - 10 - Position Offset - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - - - True - False - 3 - - 7680x4320 - 3840x2160 - 2048x1080 - 1920x1080 - 1440x720 - 1600x900 - 1280x720 - 800x600 - - - - True - True - 0 - - - - - True - False - 18 - - Left - -7680+0 - -3840+0 - -2048+0 - -1920+0 - -1440+0 - -1600+0 - -1280+0 - -800+0 - Right - +7680+0 - +3840+0 - +2048+0 - +1920+0 - +1440+0 - +1600+0 - +1280+0 - +800+0 - +0+0 - Top - +0+7680 - +0+3840 - +0+2048 - +0+1920 - +0+1440 - +0+1600 - 0+1280 - +0+800 - Bottum - +0-7680 - +0-3840 - +0-2048 - +0-1920 - +0-1440 - +0-1600 - 0-1280 - +0-800 - - - - True - True - 1 - - - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - - - True - False - 10 - 5 - Save Path - - - True - True - 0 - - - - - True - False - 0 - - .animatedBGstarter.sh - .animatedBGstarter2.sh - - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - - - Save - True - True - True - True - True - saveImage - True - - - - 1 - 0 - - - - - (Re)Start - True - True - True - True - True - startImage - True - - - - 0 - 0 - - - - - Stop - True - True - True - True - True - stopImage - True - - - - 0 - 1 - - - - - Close - True - True - True - True - True - closeImage - True - - - - 1 - 1 - - - - - False - True - 2 - - - - - False - False - end - 1 - - - - - False - True - 1 - 1 - - - - - - - 640 - 525 - False - 350 - True - True - helpLabel - bottom - False - - - True - False - vertical - - - True - False - - - True - True - True - Close Demo Window - closePopupImage - True - - - - False - True - end - 0 - - - - - False - True - 0 - - - - - True - False - 0 - none - - - True - False - - - - - True - True - 1 - - - - - - - 640 - 525 - False - True - True - helpLabel - bottom - - - True - False - vertical - - - True - False - bottom - - - Main Image Viewer - True - True - True - openProgImage - True - - - - False - True - 0 - - - - - True - True - True - True - - - - False - True - 1 - - - - - False - True - 0 - - - - - True - True - in - False - - - True - False - - - True - False - gtk-missing-image - 6 - - - - - - - True - True - 1 - - - - - - - 250 - False - button1 - - - True - False - vertical - - - True - False - - - True - False - icons/folder.png - - - False - True - 0 - - - - - 330 - 26 - True - True - Set Custom Default Path - Set Custom Default Path - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - - - True - False - icons/player.png - - - False - True - 0 - - - - - 330 - 26 - True - True - Set Custom Video Player - Set Custom Video Player - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - - - True - False - icons/picture.png - - - False - True - 0 - - - - - 330 - 26 - True - True - Set Custom Image Viewer - Set Custom Image Viewer - - - False - True - 1 - - - - - False - True - 2 - - - - - Save - True - True - True - saveImag - True - - - - False - True - 3 - - - - - - diff --git a/src/versions/0.0.1/GWinWrap/resources/icons/GWinWrap.png b/src/versions/0.0.1/GWinWrap/resources/icons/GWinWrap.png deleted file mode 100644 index cdd708d..0000000 Binary files a/src/versions/0.0.1/GWinWrap/resources/icons/GWinWrap.png and /dev/null differ diff --git a/src/versions/0.0.1/GWinWrap/resources/icons/folder.png b/src/versions/0.0.1/GWinWrap/resources/icons/folder.png deleted file mode 100644 index 909f052..0000000 Binary files a/src/versions/0.0.1/GWinWrap/resources/icons/folder.png and /dev/null differ diff --git a/src/versions/0.0.1/GWinWrap/resources/icons/picture.png b/src/versions/0.0.1/GWinWrap/resources/icons/picture.png deleted file mode 100644 index 46f1ae6..0000000 Binary files a/src/versions/0.0.1/GWinWrap/resources/icons/picture.png and /dev/null differ diff --git a/src/versions/0.0.1/GWinWrap/resources/icons/player.png b/src/versions/0.0.1/GWinWrap/resources/icons/player.png deleted file mode 100644 index 4f5ebda..0000000 Binary files a/src/versions/0.0.1/GWinWrap/resources/icons/player.png and /dev/null differ diff --git a/src/versions/0.0.1/GWinWrap/resources/stylesheet.css b/src/versions/0.0.1/GWinWrap/resources/stylesheet.css deleted file mode 100644 index b1a267d..0000000 --- a/src/versions/0.0.1/GWinWrap/resources/stylesheet.css +++ /dev/null @@ -1,3 +0,0 @@ -window { - -} \ No newline at end of file diff --git a/src/versions/0.0.1/GWinWrap/utils/SaveGWinWrapSettings.py b/src/versions/0.0.1/GWinWrap/utils/SaveGWinWrapSettings.py deleted file mode 100644 index a26fbb5..0000000 --- a/src/versions/0.0.1/GWinWrap/utils/SaveGWinWrapSettings.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python - -import os, json - -class SaveGWinWrapSettings: - def __init__(self): - configFolder = os.path.expanduser('~') + "/.config/gwinwrap/" - self.configFile = configFolder + "settings.ini" - - if os.path.isdir(configFolder) == False: - os.mkdir(configFolder) - - if os.path.isfile(self.configFile) == False: - open(self.configFile, 'a').close() - - - def saveSettings(self, defPath, player, imgVwr): - data = {} - data['gwinwrap_settings'] = [] - - data['gwinwrap_settings'].append({ - 'defPath' : defPath, - 'player' : player, - 'imgvwr' : imgVwr - }) - - with open(self.configFile, 'w') as outfile: - json.dump(data, outfile) - - - def retrieveSettings(self): - returnData = [] - - with open(self.configFile) as infile: - try: - data = json.load(infile) - for obj in data['gwinwrap_settings']: - returnData = [obj['defPath'], obj['player'], obj['imgvwr']] - except Exception as e: - returnData = ['', 'mplayer', 'xdg-open'] - - - if returnData[0] == '': - returnData[0] = '' - - if returnData[1] == '': - returnData[1] = 'mplayer' - - if returnData[2] == '': - returnData[2] = 'xdg-open' - - return returnData diff --git a/src/versions/0.0.1/GWinWrap/utils/SaveStateToXWinWarp.py b/src/versions/0.0.1/GWinWrap/utils/SaveStateToXWinWarp.py deleted file mode 100644 index ee0045d..0000000 --- a/src/versions/0.0.1/GWinWrap/utils/SaveStateToXWinWarp.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -import os - -class SaveStateToXWinWarp: - def __init__(self): - self.fileWriter = None - self.toSavePath = None - self.useXSvrn = None - self.xScreenVal = None - self.sveFileLoc = None - self.resolution = None - - def saveToFile(self, toSavePath, resolution, - saveLoc, useXSvrn, xScreenVal): - - self.toSavePath = toSavePath - self.useXSvrn = useXSvrn - self.xScreenVal = xScreenVal - self.resolution = resolution - userPth = os.path.expanduser('~') - - # Saves to file with selected and needed settings - if toSavePath: - if toSavePath.lower().endswith(('.png', '.jpg', '.jpeg', '.gif')): - self.sveFileLoc = userPth + "/" + ".config/nitrogen/bg-saved.cfg" - else: - self.sveFileLoc = userPth + "/" + saveLoc - elif useXSvrn and xScreenVal: - self.sveFileLoc = userPth + "/" + saveLoc - else: - return -1 - - if self.sveFileLoc: - self.fileWriter = open(self.sveFileLoc, "w") - - return self.startSave() - - def startSave(self): - applyType = 1 - output = None - - print("XScreen: " + str(self.useXSvrn)) - print(self.fileWriter) - - # XSCREENSAVER - if self.useXSvrn: - output = "xwinwrap -ov -g " + self.resolution + " -st -sp -b -nf -s -ni -- /usr/lib/xscreensaver/" + self.xScreenVal + " -window-id WID -root"; - # GIF - elif self.toSavePath.lower().endswith(('.gif')): - output = "xwinwrap -ov -g " + self.resolution + " -st -sp -b -nf -s -ni -- gifview -a -w WID " + self.toSavePath; - # Standard images using nitrogen - elif self.toSavePath.lower().endswith(('.png', 'jpg', '.jpeg')): - output = "[xin_0] \n file=" + self.toSavePath + "\nmode=0 \nbgcolor=#000000\n[xin_1] \nfile=" + self.toSavePath + "\nmode=0 \nbgcolor=#000000"; - applyType = 2; - # VIDEO - else: - output = "xwinwrap -ov -g " + self.resolution + " -st -sp -b -nf -s -ni -- mplayer -wid WID -really-quiet -ao null -loop 0 '" + self.toSavePath + "'"; - pass - - if self.fileWriter: - self.fileWriter.write(output) - self.fileWriter.close() - - return applyType; diff --git a/src/versions/0.0.1/GWinWrap/utils/__init__.py b/src/versions/0.0.1/GWinWrap/utils/__init__.py deleted file mode 100644 index 579b043..0000000 --- a/src/versions/0.0.1/GWinWrap/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from utils.SaveStateToXWinWarp import SaveStateToXWinWarp -from utils.SaveGWinWrapSettings import SaveGWinWrapSettings\