Re-added deb build pipe

This commit is contained in:
itdominator 2022-01-24 00:11:21 -06:00
parent 17dcb0322d
commit 22a53f9927
23 changed files with 1588 additions and 0 deletions

39
src/debs/build.sh Normal file
View File

@ -0,0 +1,39 @@
#!/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;

6
src/debs/chownAll.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
function main() {
sudo chown -R abaddon:abaddon .
}
main;

View File

@ -0,0 +1,8 @@
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.

View File

@ -0,0 +1,11 @@
#!/bin/bash
#postrm (script executed after uninstalling the package)
#set -e
if [ -f /bin/xwinwrap ]; then
rm /bin/xwinwrap
fi
if [ -d /opt/GWinWrap ]; then
rm -rf /opt/GWinWrap
fi

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Name=GWinWrap
Comment=Glade gui with python controls for XWinWrap
Exec=gwinwrap
Icon=/opt/GWinWrap/resources/icons/GWinWrap.png
Terminal=false
Type=Application
Categories=Accessories;System;Settings;

View File

@ -0,0 +1,41 @@
#!/usr/bin/python3
# Gtk imports
import gi, faulthandler, signal
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib
# Python imports
import inspect
from setproctitle import setproctitle
# Application imports
from utils import Settings
from signal_classes import CrossClassSignals
class Main:
def __init__(self):
setproctitle('GWinWrap')
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, gtk.main_quit)
faulthandler.enable() # For better debug info
settings = Settings()
builder = settings.returnBuilder()
# Gets the methods from the classes and sets to handler.
# Then, builder connects to any signals it needs.
classes = [CrossClassSignals(settings)]
handlers = {}
for c in classes:
methods = inspect.getmembers(c, predicate=inspect.ismethod)
handlers.update(methods)
builder.connect_signals(handlers)
window = settings.createWindow()
window.show()

View File

@ -0,0 +1,9 @@
from __init__ import Main, gtk
if __name__ == "__main__":
try:
main = Main()
gtk.main()
except Exception as e:
print(e)

Binary file not shown.

View File

@ -0,0 +1,844 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkFileFilter" id="Folders">
<mime-types>
<mime-type>inode/directory</mime-type>
</mime-types>
</object>
<object class="GtkListStore" id="XScreensaver List">
<columns>
<!-- column-name XScreensavers -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkImage" id="clearImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-clear</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="closeImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-quit</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="closePopupImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-cancel</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="openProgImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="saveImag">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-save</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="saveImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-save</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="settingsImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Settings....</property>
<property name="stock">gtk-properties</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="startImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-media-play</property>
<property name="icon_size">3</property>
</object>
<object class="GtkImage" id="stopImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-media-stop</property>
<property name="icon_size">3</property>
</object>
<object class="GtkWindow" id="Main_Window">
<property name="width_request">950</property>
<property name="height_request">600</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">GWinWrap</property>
<property name="window_position">center</property>
<property name="default_width">950</property>
<property name="default_height">600</property>
<property name="icon">icons/GWinWrap.png</property>
<property name="gravity">center</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">15</property>
<property name="margin_top">15</property>
<property name="margin_bottom">15</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">5</property>
<child>
<object class="GtkLabel" id="helpLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">15</property>
<property name="label" translatable="yes">Note: Double click an image to view the video or image.</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="selectedDirDialog">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Chose Dream Scene / Image Directory</property>
<property name="action">select-folder</property>
<property name="create_folders">False</property>
<property name="filter">Folders</property>
<property name="title" translatable="yes">Dream Scene / Image Dir</property>
<signal name="file-set" handler="setNewDir" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">settingsImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="popSttingsWindow" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkProgressBar" id="loadProgress">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_text">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="imageGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="row_spacing">10</property>
<property name="column_spacing">10</property>
<property name="row_homogeneous">True</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkLabel" id="gridLabel">
<property name="width_request">640</property>
<property name="height_request">525</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Choose Image/Video Directory...</property>
<attributes>
<attribute name="font-desc" value="Times New Roman, 28"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Clear</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">clearImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="clearSelection" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="width_request">300</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">15</property>
<property name="margin_top">15</property>
<property name="margin_bottom">15</property>
<property name="hexpand">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="useXScrnList">
<property name="label" translatable="yes">Use XScreenSaver</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">center</property>
<property name="margin_bottom">5</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="toggleXscreenUsageField" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="xScreenSvrList">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="model">XScreensaver List</property>
<property name="headers_visible">False</property>
<signal name="button-press-event" handler="previewXscreen" swapped="no"/>
<signal name="cursor-changed" handler="passXScreenVal" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="listColumn">
<property name="title" translatable="yes">XScreensaves</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="label" translatable="yes">Playback Resolutions</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="label" translatable="yes">Position Offset</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBoxText" id="playbackResolution">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">3</property>
<items>
<item translatable="yes">7680x4320</item>
<item translatable="yes">3840x2160</item>
<item translatable="yes">2048x1080</item>
<item translatable="yes">1920x1080</item>
<item translatable="yes">1440x720</item>
<item translatable="yes">1600x900</item>
<item translatable="yes">1280x720</item>
<item translatable="yes">800x600</item>
</items>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="posOffset">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Save Path</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="saveLoc">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">0</property>
<items>
<item translatable="yes">.animatedBGstarter.sh</item>
<item translatable="yes">.animatedBGstarter2.sh</item>
<item translatable="yes">.animatedBGstarter3.sh</item>
</items>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="image">saveImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="saveToFile" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">(Re)Start</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="image">startImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="applySttngs" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Stop</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="image">stopImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="killXWinWrp" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="image">closeImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="closeProgram" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">1</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkPopover" id="demoPreviewPopWindow">
<property name="width_request">640</property>
<property name="height_request">525</property>
<property name="can_focus">False</property>
<property name="margin_right">350</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="relative_to">helpLabel</property>
<property name="position">bottom</property>
<property name="modal">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Close Demo Window</property>
<property name="image">closePopupImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="closeDemoWindow" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAspectFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkDrawingArea" id="demoPreview">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkPopover" id="previewWindow">
<property name="width_request">640</property>
<property name="height_request">525</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="relative_to">helpLabel</property>
<property name="position">bottom</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="baseline_position">bottom</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Main Image Viewer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">openProgImage</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="openMainImageViewer" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="closePopup" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<property name="overlay_scrolling">False</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="previewImg">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
<property name="icon_size">6</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkPopover" id="settingsWindow">
<property name="width_request">250</property>
<property name="can_focus">False</property>
<property name="relative_to">button1</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">icons/folder.png</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="customDefaultPath">
<property name="width_request">330</property>
<property name="height_request">26</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Set Custom Default Path</property>
<property name="placeholder_text" translatable="yes">Set Custom Default Path</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">icons/player.png</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="customVideoPlyr">
<property name="width_request">330</property>
<property name="height_request">26</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Set Custom Video Player</property>
<property name="placeholder_text" translatable="yes">Set Custom Video Player</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">icons/picture.png</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="customImgVwr">
<property name="width_request">330</property>
<property name="height_request">26</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Set Custom Image Viewer</property>
<property name="placeholder_text" translatable="yes">Set Custom Image Viewer</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">saveImag</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="saveToSettingsFile" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,3 @@
window {
}

View File

@ -0,0 +1,397 @@
# Gtk imports
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib as glib
from gi.repository import GdkPixbuf
# Python imports
import threading, subprocess, signal, os, sys, re, hashlib, time
from os import listdir
from os.path import isfile, join
# Application imports
from utils import SaveStateToXWinWarp, SaveGWinWrapSettings
def threaded(fn):
def wrapper(*args, **kwargs):
threading.Thread(target=fn, args=args, kwargs=kwargs).start()
return wrapper
class CrossClassSignals:
def __init__(self, settings):
self.settings = settings
self.builder = self.settings.returnBuilder()
self.WINDOW = self.builder.get_object("Main_Window").get_window()
self.stateSaver = SaveStateToXWinWarp()
self.sttngsSver = SaveGWinWrapSettings()
# 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 = "<span>Note: Double click an image to view the video or image.</span>"
self.savedLabel = "<span foreground=\"#88cc27\">Saved settings...</span>"
self.appliedLabel = "<span foreground=\"#88cc27\">Running xwinwrap...</span>"
self.stoppedLabel = "<span foreground=\"#88cc27\">Stopped xwinwrap...</span>"
# 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.setPosData()
self.retrieveSettings()
def setNewDir(self, widget, data=None):
dir = widget.get_filename()
threading.Thread(target=self.newDir, args=(dir,)).start()
@threaded
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("<span foreground=\"#b30ec2\">" + dirPath.strip(self.usrHome) + "</span>")
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.")
continue
glib.idle_add(self.preGridSetup, (eveBox, thumbnl, ))
glib.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):
# Stream duration
command = ["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries", "stream=duration", "-of", "default=noprint_wrappers=1:nokey=1", fullPathFile]
data = subprocess.run(command, stdout=subprocess.PIPE)
duration = data.stdout.decode('utf-8')
# Format (container) duration
if "N/A" in duration:
command = ["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", fullPathFile]
data = subprocess.run(command , stdout=subprocess.PIPE)
duration = data.stdout.decode('utf-8')
# Stream duration type: image2
if "N/A" in duration:
command = ["ffprobe", "-v", "error", "-select_streams", "v:0", "-f", "image2", "-show_entries", "stream=duration", "-of", "default=noprint_wrappers=1:nokey=1", fullPathFile]
data = subprocess.run(command, stdout=subprocess.PIPE)
duration = data.stdout.decode('utf-8')
# Format (container) duration type: image2
if "N/A" in duration:
command = ["ffprobe", "-v", "error", "-f", "image2", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", fullPathFile]
data = subprocess.run(command , stdout=subprocess.PIPE)
duration = data.stdout.decode('utf-8')
# Get frame roughly 35% through video
grabTime = str( int( float( duration.split(".")[0] ) * 0.35) )
command = ["ffmpeg", "-ss", grabTime, "-i", fullPathFile, "-an", "-vframes", "1", "-s", "320x180", "-q:v", "2", hashImgpth]
subprocess.call(command)
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("<span foreground=\"#e0cc64\">" + params[1] + "</span>")
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_Window").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_Window").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)
if self.defPath:
self.newDir(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, self.player)
if self.applyType == -1:
self.helpLabel.set_markup("<span foreground=\"#e0cc64\">Nothing saved...</span>")
return
self.helpLabel.set_markup(self.savedLabel)
def applySttngs(self, widget, data=None):
os.system("killall xwinwrap &")
if self.applyType == 1:
files = os.listdir(self.usrHome)
for file in files:
fPath = self.usrHome + "/" + file
if os.path.isfile(fPath) and "animatedBGstarter" in file:
os.system("bash -c '~/" + file + "' &")
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("<span foreground=\"#e0cc64\">" + params[1] + "</span>")
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("<span foreground=\"#e0cc64\"></span>")
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):
os.kill(self.demoAreaPid, signal.SIGTERM) #or signal.SIGKILL
self.demoAreaPid = None
time.sleep(.200)
self.builder.get_object("demoPreviewPopWindow").popdown()
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 setPosData(self):
monitors = self.settings.getMonitorData()
posOff = self.builder.get_object("posOffset")
for monitor in monitors:
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)
def closeProgram(self, widget, data=None):
sys.exit(0)

View File

@ -0,0 +1 @@
from signal_classes.CrossClassSignals import CrossClassSignals

View File

@ -0,0 +1,52 @@
#!/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

View File

@ -0,0 +1,69 @@
#!/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
self.player = None
def saveToFile(self, toSavePath, resolution,
saveLoc, useXSvrn, xScreenVal, player):
self.toSavePath = toSavePath
self.useXSvrn = useXSvrn
self.xScreenVal = xScreenVal
self.resolution = resolution
self.player = player
userPth = os.path.expanduser('~')
# Saves to file with selected and needed settings
if toSavePath:
if toSavePath.lower().endswith(('.png', '.jpg', '.jpeg')):
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
# 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] \nfile=" + self.toSavePath + "\nmode=0 \nbgcolor=#000000\n\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 -- " + self.player + " -wid WID -really-quiet -ao null -loop 0 '" + self.toSavePath + "'";
pass
try:
if self.fileWriter:
self.fileWriter.write(output)
self.fileWriter.close()
except Exception as e:
print(":: Write failed! ::")
print(e)
return applyType;

View File

@ -0,0 +1,74 @@
# Gtk imports
import gi, cairo
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
# Python imports
import os
# Application imports
class Settings:
def __init__(self):
self.builder = gtk.Builder()
self.builder.add_from_file("resources/Main_Window.glade")
# 'Filters'
self.office = ('.doc', '.docx', '.xls', '.xlsx', '.xlt', '.xltx', '.xlm',
'.ppt', 'pptx', '.pps', '.ppsx', '.odt', '.rtf')
self.vids = ('.mkv', '.avi', '.flv', '.mov', '.m4v', '.mpg', '.wmv',
'.mpeg', '.mp4', '.webm')
self.txt = ('.txt', '.text', '.sh', '.cfg', '.conf')
self.music = ('.psf', '.mp3', '.ogg' , '.flac')
self.images = ('.png', '.jpg', '.jpeg', '.gif')
self.pdf = ('.pdf')
def createWindow(self):
# Get window and connect signals
window = self.builder.get_object("Main_Window")
window.connect("delete-event", gtk.main_quit)
self.setWindowData(window)
return window
def setWindowData(self, window):
screen = window.get_screen()
visual = screen.get_rgba_visual()
if visual != None and screen.is_composited():
window.set_visual(visual)
# 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)
# window.set_app_paintable(True)
def getMonitorData(self):
screen = self.builder.get_object("Main_Window").get_screen()
monitors = []
for m in range(screen.get_n_monitors()):
monitors.append(screen.get_monitor_geometry(m))
for monitor in monitors:
print(str(monitor.width) + "x" + str(monitor.height) + "+" + str(monitor.x) + "+" + str(monitor.y))
return monitors
def returnBuilder(self): return self.builder
# Filter returns
def returnOfficeFilter(self): return self.office
def returnVidsFilter(self): return self.vids
def returnTextFilter(self): return self.txt
def returnMusicFilter(self): return self.music
def returnImagesFilter(self): return self.images
def returnPdfFilter(self): return self.pdf

View File

@ -0,0 +1,3 @@
from utils.Settings import Settings
from utils.SaveStateToXWinWarp import SaveStateToXWinWarp
from utils.SaveGWinWrapSettings import SaveGWinWrapSettings

View File

@ -0,0 +1,22 @@
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
<http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
of the GNU General Public License.