New version update with UI and UX overhauled. Added mplayer launching to video thumbnail images too. Fixed some loading issues and file type checks too.

This commit is contained in:
Maxim Stewart 2016-10-22 22:21:10 -05:00
parent 3c61f0b890
commit 0f0980d337
45 changed files with 835 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@ Package: FXWinWrap
Version: 0.1-1 Version: 0.1-1
Section: base Section: base
Priority: optional Priority: optional
Architecture: amd64 Architecture: i386
Depends: openjdk-8-jre (>= 8u45-b14-1) Depends: openjdk-8-jre (>= 8u45-b14-1)
Maintainer: Maxim Stewart maximstewart1@gmail.com Maintainer: Maxim Stewart maximstewart1@gmail.com
Description: FXWinWrap Description: FXWinWrap

View File

@ -0,0 +1,9 @@
Package: FXWinWrap
Version: 0.1-2
Section: base
Priority: optional
Architecture: amd64
Depends: openjdk-8-jre (>= 8u45-b14-1), mplayer2 (>=2.0-728-g2c378c7-4), gifsicle (>=1.86-1), nitrogen (>=1.5.2-2)
Maintainer: Maxim Stewart maximstewart1@gmail.com
Description: FXWinWrap
A GUI to handle setting XWinWrap options.

View File

@ -0,0 +1,20 @@
#!/bin/bash
#postrm (script executed after uninstalling the package)
#set -e
if [ -f /bin/fxwinwrap ]; then
rm /bin/fxwinwrap
fi
if [ -d /opt/FXWinWrap ]; then
rm -rf /bin/fxwinwrap
fi
if [ -x "`which xdg-desktop-menu 2>/dev/null`" ]; then
xdg-desktop-menu uninstall /usr/share/applications/FXWinWrap.desktop
xdg-desktop-menu forceupdate --mode user
fi
if [ -x "`which update-menus 2>/dev/null`" ]; then
update-menus
fi

Binary file not shown.

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>
<?scenebuilder-background-color 0x444444ff?>
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" style="" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller">
<children>
<ScrollPane hbarPolicy="NEVER" prefHeight="345.0" prefWidth="535.0" vbarPolicy="AS_NEEDED" AnchorPane.bottomAnchor="138.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="116.07">
<content>
<VBox fx:id="thumbImgView" prefHeight="335.0" prefWidth="532.0">
<children>
<Label id="dir" fx:id="dirLbl" onMouseClicked="#setNewDir" opacity="0.5" prefHeight="330.0" prefWidth="532.0" text="Choose Image or Video Directory..." textAlignment="CENTER" textFill="#dfdfdf" textOverrun="ELLIPSIS" wrapText="true">
<font>
<Font name="System Bold" size="32.0" />
</font>
</Label>
</children>
</VBox>
</content>
</ScrollPane>
<ListView fx:id="selXScreenSvr" onMouseClicked="#passXScreenVal" prefHeight="345.93" prefWidth="158.0" AnchorPane.bottomAnchor="138.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="116.07">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="electricsheep " />
<String fx:value="atlantis" />
<String fx:value="atunnel " />
<String fx:value="blinkbox " />
<String fx:value="blocktube" />
<String fx:value="bouncingcow " />
<String fx:value="boxfit " />
<String fx:value="bsod" />
<String fx:value="bubble3d " />
<String fx:value="bumps " />
<String fx:value="cage" />
<String fx:value="carousel " />
<String fx:value="cube21 " />
<String fx:value="cubenetic" />
<String fx:value="cubicgrid " />
<String fx:value="cwaves " />
<String fx:value="dangerball" />
<String fx:value="fiberlamp " />
<String fx:value="fireworkx " />
<String fx:value="flipflop" />
<String fx:value="fliptext " />
<String fx:value="flow " />
<String fx:value="flurry" />
<String fx:value="flyingtoasters " />
<String fx:value="gflux " />
<String fx:value="glcells" />
<String fx:value="gleidescope " />
<String fx:value="glknots " />
<String fx:value="glmatrix" />
<String fx:value="glschool " />
<String fx:value="glslideshow " />
<String fx:value="glsnake" />
<String fx:value="hypertorus " />
<String fx:value="hypnowheel " />
<String fx:value="interaggregate" />
<String fx:value="intermomentary " />
<String fx:value="jigglypuff " />
<String fx:value="jigsaw" />
<String fx:value="julia " />
<String fx:value="lament " />
<String fx:value="lockward" />
<String fx:value="metaballs " />
<String fx:value="moebiusgears " />
<String fx:value="molecule" />
<String fx:value="morph3d " />
<String fx:value="noof " />
<String fx:value="phosphor" />
<String fx:value="photopile " />
<String fx:value="pinion " />
<String fx:value="popsquares" />
<String fx:value="ripples " />
<String fx:value="skytentacles " />
<String fx:value="slidescreen" />
<String fx:value="stonerview " />
<String fx:value="strange " />
<String fx:value="substrate" />
<String fx:value="tangram " />
<String fx:value="whirlwindwarp " />
<String fx:value="wormhole" />
<String fx:value="xflame " />
<String fx:value="xrayswarm " />
<String fx:value="companioncube" />
<String fx:value="fuzzyflakes " />
<String fx:value="galaxy " />
<String fx:value="glplanet" />
<String fx:value="penetrate" />
</FXCollections>
</items>
</ListView>
<Label layoutY="230.0" text="Right Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="576.5" />
<Label layoutY="497.0" text="Save Path:" AnchorPane.leftAnchor="220.0" AnchorPane.rightAnchor="660.0" />
<Label fx:id="errorField" layoutX="206.0" layoutY="481.0" prefWidth="168.0" text="" textFill="#ff3333" />
<Button id="saveBttn" layoutX="543.0" layoutY="537.0" mnemonicParsing="false" onAction="#saveToFile" prefHeight="50.0" prefWidth="169.0" text="Save Selection" />
<Button id="applyBttn" layoutX="725.0" layoutY="537.0" mnemonicParsing="false" onAction="#applySttngs" prefHeight="50.0" prefWidth="100.0" text="Apply" />
<Button id="restartBttn" layoutX="14.0" layoutY="536.0" mnemonicParsing="false" onAction="#restartXWinWrp" prefHeight="50.0" prefWidth="169.0" text="RE-Start XWinWrap" />
<Button id="killBttn" layoutX="200.0" layoutY="537.0" mnemonicParsing="false" onAction="#killXWinWrp" prefHeight="50.0" prefWidth="169.0" text="Kill XWinWrap" />
<Button fx:id="closeBttn" layoutX="838.0" layoutY="537.0" mnemonicParsing="false" onAction="#closeProg" prefHeight="50.0" prefWidth="100.0" text="Close" />
<ChoiceBox fx:id="listSaveLoc" layoutY="497.0" prefHeight="29.0" prefWidth="283.0" AnchorPane.leftAnchor="307.0" AnchorPane.rightAnchor="360.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value=".animatedBGstarter.sh" />
<String fx:value=".animatedBGstarter2.sh" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listRgthRes" layoutY="254.0" prefHeight="29.0" prefWidth="169.0" value="+1920+0" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="+1920+0" />
<String fx:value="+1440+0" />
<String fx:value="+1600+0" />
<String fx:value="+1280+0" />
<String fx:value="+800+0" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listLftRes" layoutY="149.0" prefHeight="29.0" prefWidth="169.0" value="1920x1080" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="1920x1080" />
<String fx:value="1440x720" />
<String fx:value="1600x900" />
<String fx:value="1280x720" />
<String fx:value="800x600" />
</FXCollections>
</items>
</ChoiceBox>
<CheckBox fx:id="lftScrn" layoutY="195.0" mnemonicParsing="false" prefWidth="114.17000000000002" selected="true" text="Left Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="rghtScrn" allowIndeterminate="false" layoutY="300.0" mnemonicParsing="false" prefWidth="114.17000000000002" text="Right Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="useXSvrn" layoutY="366.0" mnemonicParsing="false" text="Use XScreenSaver" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="603.5" />
<Label layoutY="125.0" text="Left Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="586.5" />
<TextField id="txtDirPath" fx:id="filePathField" layoutX="14.0" layoutY="50.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="File Path" />
<TextField id="txtDirPath" fx:id="dirPathField" layoutX="14.0" layoutY="15.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="Directory Path" />
<Button fx:id="clear" layoutX="882.0" layoutY="85.0" mnemonicParsing="false" onAction="#clearBttnClick" text="Clear" />
<Label layoutX="14.0" layoutY="88.0" text="XScreenSaver List" />
<Label layoutX="401.0" layoutY="465.0" prefWidth="532.0" text="Note: Double click an image to view the video or image." textFill="#dfdfdf" />
</children>
</AnchorPane>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -0,0 +1,3 @@
.root {
-fx-background: rgba(68, 68, 68, 0.8); // == #444444;
}

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=FXWinWrap
Comment=JavaFX gui for XWinWrap
Exec=/bin/fxwinwrap
Icon=/opt/FXWinWrap/resources/fxwinwrap.png
Terminal=false
Type=Application
Categories=Applications;System;
MimeType=application/fxml;

View File

@ -0,0 +1,9 @@
Package: FXWinWrap
Version: 0.1-2
Section: base
Priority: optional
Architecture: i386
Depends: openjdk-8-jre (>= 8u45-b14-1), mplayer2 (>=2.0-728-g2c378c7-4), gifsicle (>=1.86-1), nitrogen (>=1.5.2-2)
Maintainer: Maxim Stewart maximstewart1@gmail.com
Description: FXWinWrap
A GUI to handle setting XWinWrap options.

View File

@ -0,0 +1,20 @@
#!/bin/bash
#postrm (script executed after uninstalling the package)
#set -e
if [ -f /bin/fxwinwrap ]; then
rm /bin/fxwinwrap
fi
if [ -d /opt/FXWinWrap ]; then
rm -rf /bin/fxwinwrap
fi
if [ -x "`which xdg-desktop-menu 2>/dev/null`" ]; then
xdg-desktop-menu uninstall /usr/share/applications/FXWinWrap.desktop
xdg-desktop-menu forceupdate --mode user
fi
if [ -x "`which update-menus 2>/dev/null`" ]; then
update-menus
fi

Binary file not shown.

View File

@ -0,0 +1,3 @@
#!/bin/bash
java XWWMenu

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>
<?scenebuilder-background-color 0x444444ff?>
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" style="" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller">
<children>
<ScrollPane hbarPolicy="NEVER" prefHeight="345.0" prefWidth="535.0" vbarPolicy="AS_NEEDED" AnchorPane.bottomAnchor="138.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="116.07">
<content>
<VBox fx:id="thumbImgView" prefHeight="335.0" prefWidth="532.0">
<children>
<Label id="dir" fx:id="dirLbl" onMouseClicked="#setNewDir" opacity="0.5" prefHeight="330.0" prefWidth="532.0" text="Choose Image or Video Directory..." textAlignment="CENTER" textFill="#dfdfdf" textOverrun="ELLIPSIS" wrapText="true">
<font>
<Font name="System Bold" size="32.0" />
</font>
</Label>
</children>
</VBox>
</content>
</ScrollPane>
<ListView fx:id="selXScreenSvr" onMouseClicked="#passXScreenVal" prefHeight="345.93" prefWidth="158.0" AnchorPane.bottomAnchor="138.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="116.07">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="electricsheep " />
<String fx:value="atlantis" />
<String fx:value="atunnel " />
<String fx:value="blinkbox " />
<String fx:value="blocktube" />
<String fx:value="bouncingcow " />
<String fx:value="boxfit " />
<String fx:value="bsod" />
<String fx:value="bubble3d " />
<String fx:value="bumps " />
<String fx:value="cage" />
<String fx:value="carousel " />
<String fx:value="cube21 " />
<String fx:value="cubenetic" />
<String fx:value="cubicgrid " />
<String fx:value="cwaves " />
<String fx:value="dangerball" />
<String fx:value="fiberlamp " />
<String fx:value="fireworkx " />
<String fx:value="flipflop" />
<String fx:value="fliptext " />
<String fx:value="flow " />
<String fx:value="flurry" />
<String fx:value="flyingtoasters " />
<String fx:value="gflux " />
<String fx:value="glcells" />
<String fx:value="gleidescope " />
<String fx:value="glknots " />
<String fx:value="glmatrix" />
<String fx:value="glschool " />
<String fx:value="glslideshow " />
<String fx:value="glsnake" />
<String fx:value="hypertorus " />
<String fx:value="hypnowheel " />
<String fx:value="interaggregate" />
<String fx:value="intermomentary " />
<String fx:value="jigglypuff " />
<String fx:value="jigsaw" />
<String fx:value="julia " />
<String fx:value="lament " />
<String fx:value="lockward" />
<String fx:value="metaballs " />
<String fx:value="moebiusgears " />
<String fx:value="molecule" />
<String fx:value="morph3d " />
<String fx:value="noof " />
<String fx:value="phosphor" />
<String fx:value="photopile " />
<String fx:value="pinion " />
<String fx:value="popsquares" />
<String fx:value="ripples " />
<String fx:value="skytentacles " />
<String fx:value="slidescreen" />
<String fx:value="stonerview " />
<String fx:value="strange " />
<String fx:value="substrate" />
<String fx:value="tangram " />
<String fx:value="whirlwindwarp " />
<String fx:value="wormhole" />
<String fx:value="xflame " />
<String fx:value="xrayswarm " />
<String fx:value="companioncube" />
<String fx:value="fuzzyflakes " />
<String fx:value="galaxy " />
<String fx:value="glplanet" />
<String fx:value="penetrate" />
</FXCollections>
</items>
</ListView>
<Label layoutY="230.0" text="Right Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="576.5" />
<Label layoutY="497.0" text="Save Path:" AnchorPane.leftAnchor="220.0" AnchorPane.rightAnchor="660.0" />
<Label fx:id="errorField" layoutX="206.0" layoutY="481.0" prefWidth="168.0" text="" textFill="#ff3333" />
<Button id="saveBttn" layoutX="543.0" layoutY="537.0" mnemonicParsing="false" onAction="#saveToFile" prefHeight="50.0" prefWidth="169.0" text="Save Selection" />
<Button id="applyBttn" layoutX="725.0" layoutY="537.0" mnemonicParsing="false" onAction="#applySttngs" prefHeight="50.0" prefWidth="100.0" text="Apply" />
<Button id="restartBttn" layoutX="14.0" layoutY="536.0" mnemonicParsing="false" onAction="#restartXWinWrp" prefHeight="50.0" prefWidth="169.0" text="RE-Start XWinWrap" />
<Button id="killBttn" layoutX="200.0" layoutY="537.0" mnemonicParsing="false" onAction="#killXWinWrp" prefHeight="50.0" prefWidth="169.0" text="Kill XWinWrap" />
<Button fx:id="closeBttn" layoutX="838.0" layoutY="537.0" mnemonicParsing="false" onAction="#closeProg" prefHeight="50.0" prefWidth="100.0" text="Close" />
<ChoiceBox fx:id="listSaveLoc" layoutY="497.0" prefHeight="29.0" prefWidth="283.0" AnchorPane.leftAnchor="307.0" AnchorPane.rightAnchor="360.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value=".animatedBGstarter.sh" />
<String fx:value=".animatedBGstarter2.sh" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listRgthRes" layoutY="254.0" prefHeight="29.0" prefWidth="169.0" value="+1920+0" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="+1920+0" />
<String fx:value="+1440+0" />
<String fx:value="+1600+0" />
<String fx:value="+1280+0" />
<String fx:value="+800+0" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listLftRes" layoutY="149.0" prefHeight="29.0" prefWidth="169.0" value="1920x1080" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="1920x1080" />
<String fx:value="1440x720" />
<String fx:value="1600x900" />
<String fx:value="1280x720" />
<String fx:value="800x600" />
</FXCollections>
</items>
</ChoiceBox>
<CheckBox fx:id="lftScrn" layoutY="195.0" mnemonicParsing="false" prefWidth="114.17000000000002" selected="true" text="Left Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="rghtScrn" allowIndeterminate="false" layoutY="300.0" mnemonicParsing="false" prefWidth="114.17000000000002" text="Right Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="useXSvrn" layoutY="366.0" mnemonicParsing="false" text="Use XScreenSaver" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="603.5" />
<Label layoutY="125.0" text="Left Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="586.5" />
<TextField id="txtDirPath" fx:id="filePathField" layoutX="14.0" layoutY="50.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="File Path" />
<TextField id="txtDirPath" fx:id="dirPathField" layoutX="14.0" layoutY="15.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="Directory Path" />
<Button fx:id="clear" layoutX="882.0" layoutY="85.0" mnemonicParsing="false" onAction="#clearBttnClick" text="Clear" />
<Label layoutX="14.0" layoutY="88.0" text="XScreenSaver List" />
<Label layoutX="401.0" layoutY="465.0" prefWidth="532.0" text="Note: Double click an image to view the video or image." textFill="#dfdfdf" />
</children>
</AnchorPane>

View File

@ -0,0 +1,5 @@
#!/bin/bash
### nohup is needed to keep child process alive from java's
xterm -e nohup ~/.animatedBGstarter.sh
xterm -e nohup ~/.animatedBGstarter2.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -0,0 +1,3 @@
.root {
-fx-background: rgba(68, 68, 68, 0.8); // == #444444;
}

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=FXWinWrap
Comment=JavaFX gui for XWinWrap
Exec=/bin/fxwinwrap
Icon=/opt/FXWinWrap/resources/fxwinwrap.png
Terminal=false
Type=Application
Categories=Applications;System;
MimeType=application/fxml;

3
src/versions/v0.0.1/launch.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
java XWWMenu

View File

@ -0,0 +1,5 @@
#!/bin/bash
### nohup is needed to keep child process alive from java's
xterm -e nohup ~/.animatedBGstarter.sh
xterm -e nohup ~/.animatedBGstarter2.sh

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

View File

@ -0,0 +1,250 @@
import javafx.stage.*;
import javafx.scene.Scene;
import javafx.fxml.FXML;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.control.*;
import javafx.event.ActionEvent;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode;
import javafx.scene.input.MouseEvent;
import javafx.geometry.Insets;
import java.io.*;
public class Controller {
private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir
private FileChooser fileChooser = new FileChooser(); // Selects a file
private FileWriter fileWriter; // Writes to files
private File directory, sveFileLoc; // Path to file or dir
private Image pth = new Image("."); // Path to image
private Image imgPath; // tmp
private ImageView imgView = new ImageView(pth); // Image view area
private Process pb; // Process runner
private String tmpPath, resolution, xScreenVal, output,
startScrpt = System.getProperty("user.dir") + "/resources/bin/StartXWW.sh", // Gets shell that starts stuff local
ffmpg = System.getProperty("user.dir") + "/resources/bin/ffmpegthumbnailer", // Gets ffmpeg local
textAreaPth = "";
private int applyType = 1;
private Stage fileChooserStage;
@FXML private ListView<?> selXScreenSvr;
@FXML private Label dirLbl, errorField; // Labels
@FXML private VBox thumbImgView; // Vertical image area
@FXML private TextField dirPathField, filePathField; // Text fields
@FXML private CheckBox lftScrn, rghtScrn, useXSvrn; // Check boxes
@FXML private ChoiceBox<?> listLftRes, listRgthRes, listSaveLoc; // Choice box fields
@FXML private Button applyBttn, closeBttn, fileBttn, clear, // Buttons
killBttn, restartBttn, saveBttn;
@FXML void initialize() {
assert clear != null : "fx:id=\"clear\" was not injected: check your FXML file 'Window.fxml'.";
assert closeBttn != null : "fx:id=\"closeBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert dirLbl != null : "fx:id=\"dirLbl\" was not injected: check your FXML file 'Window.fxml'.";
assert thumbImgView != null : "fx:id=\"thumbImgView\" was not injected: check your FXML file 'Window.fxml'.";
assert dirPathField != null : "fx:id=\"dirPathField\" was not injected: check your FXML file 'Window.fxml'.";
assert filePathField != null : "fx:id=\"filePathField\" was not injected: check your FXML file 'Window.fxml'.";
assert applyBttn != null : "fx:id=\"applyBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert fileBttn != null : "fx:id=\"fileBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert errorField != null : "fx:id=\"errorField\" was not injected: check your FXML file 'Window.fxml'.";
assert killBttn != null : "fx:id=\"killBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert lftScrn != null : "fx:id=\"lftScrn\" was not injected: check your FXML file 'Window.fxml'.";
assert listLftRes != null : "fx:id=\"listLftRes\" was not injected: check your FXML file 'Window.fxml'.";
assert listRgthRes != null : "fx:id=\"listRgthRes\" was not injected: check your FXML file 'Window.fxml'.";
assert listSaveLoc != null : "fx:id=\"listSaveLoc\" was not injected: check your FXML file 'Window.fxml'.";
assert restartBttn != null : "fx:id=\"restartBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert rghtScrn != null : "fx:id=\"rghtScrn\" was not injected: check your FXML file 'Window.fxml'.";
assert saveBttn != null : "fx:id=\"saveBttn\" was not injected: check your FXML file 'Window.fxml'.";
assert selXScreenSvr != null : "fx:id=\"selXScreenSvr\" was not injected: check your FXML file 'Window.fxml'.";
assert filePathField != null : "fx:id=\"filePathField\" was not injected: check your FXML file 'Window.fxml'.";
assert useXSvrn != null : "fx:id=\"useXSvrn\" was not injected: check your FXML file 'Window.fxml'.";
}
// Sets the dir path in dir label area and continues with scan
@FXML void setNewDir(MouseEvent event) { newDir(); }
@FXML void onEnter(KeyEvent event) {
if (event.getCode().equals(KeyCode.ENTER)) {
textAreaPth = dirPathField.getText();
newDir();
}
}
// Gets list of files then checks if image or video.
// Creates thumbnail imgs for the vids and then sets up
// onclick events to either play video or open enlarged image.
public void newDir() {
Stage stage = new Stage();
if (textAreaPth != "")
directory = new File(textAreaPth);
else
directory = folderChooser.showDialog(stage);
File[] fileList = directory.listFiles(); // Listed contents of diir
int size = fileList.length; // List length
double posY = 0.0;
thumbImgView.getChildren().clear(); // Clears children if any to setup for new images
dirPathField.setText("" + directory);
for (int i=0; i<size; i++) {
String path = "" + fileList[i];
imgView.setFitWidth(535);
imgView.setFitHeight(345);
imgView.setLayoutY(posY);
// Video or image click actions
if (fileList[i].getName().contains(".mp4") || fileList[i].getName().contains(".mpeg") ||
fileList[i].getName().contains(".mpg") || fileList[i].getName().contains(".wmv") ||
fileList[i].getName().contains(".mkv") || fileList[i].getName().contains(".flv") ||
fileList[i].getName().contains(".webm") || fileList[i].getName().contains(".avi")) {
String movieImg = ffmpg + " -w -t='00:30:00' -c png -i " + fileList[i] +
" -s 800 -o /tmp/image.png",
vExec = "mplayer " + fileList[i];
try {
pb = Runtime.getRuntime().exec(movieImg);
pb.waitFor();
} catch(Throwable imgIOErr) {
System.out.println(imgIOErr);
}
imgView = new ImageView("file:///tmp/image.png");
thumbImgView.getChildren().add(imgView);
imgView.setOnMouseClicked(mouse -> {
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
try {
pb = Runtime.getRuntime().exec(vExec);
} catch(IOException vidIOErr) {
throw new UncheckedIOException(vidIOErr);
}
}
filePathField.setText(path);
});
} else if(fileList[i].getName().contains(".png") || fileList[i].getName().contains(".jpg")||
fileList[i].getName().contains(".gif") || fileList[i].getName().contains(".jpeg")) {
imgView = new ImageView("file://" + fileList[i]);
thumbImgView.getChildren().add(imgView);
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
imgView.setOnMouseClicked(mouse -> {
if (mouse.getClickCount() == 2 && !mouse.isConsumed()) {
mouse.consume();
displayImg(imgViewPoped, path);
}
filePathField.setText(path);
});
} else {
System.out.println("Not a video or image file.");
}
posY = posY + 355.0;
}
}
// View Image enlarged Note, sets up a seperate stage and scene with auto enlargment
public void displayImg(ImageView imgViewPoped, String path) {
Stage popOut = new Stage();
Pane pane = new Pane();
Scene scene = new Scene(pane, 1280, 900);
imgViewPoped.setLayoutX(0);
imgViewPoped.setLayoutY(0);
imgViewPoped.fitWidthProperty().bind(pane.widthProperty());
imgViewPoped.fitHeightProperty().bind(pane.heightProperty());
pane.getChildren().addAll(imgViewPoped);
popOut.setTitle(path);
popOut.setScene(scene);
popOut.show();
}
// Kill xwinwrap process
@FXML void killXWinWrp(ActionEvent event) throws Exception {
pb = Runtime.getRuntime().exec("killall xwinwrap &");
pb.waitFor();
}
// Restart xwinwrap process
@FXML void restartXWinWrp(ActionEvent event) throws Exception {
pb = Runtime.getRuntime().exec("killall xwinwrap &");
pb = Runtime.getRuntime().exec(startScrpt);
pb.waitFor();
}
// Pass resolution values
@FXML void passXScreenVal() {
xScreenVal = "" + selXScreenSvr.getSelectionModel().getSelectedItem();
}
// Preliminary setup to save settings to files
@FXML void saveToFile(ActionEvent saveEvent) throws Exception {
// Saves to file with selected and needed settings
if(filePathField.getText().toLowerCase().contains(".jpg") ||
filePathField.getText().toLowerCase().contains(".jpeg") ||
filePathField.getText().toLowerCase().contains(".png") ||
filePathField.getText().toLowerCase().contains(".gif"))
sveFileLoc = new File(System.getProperty("user.home") + "/" + ".config/nitrogen/bg-saved.cfg");
else
sveFileLoc = new File(System.getProperty("user.home") + "/" + listSaveLoc.getValue());
fileWriter = new FileWriter(sveFileLoc);
errorField.setText("");
if (lftScrn.isSelected() == true && rghtScrn.isSelected() == true)
errorField.setText("Please only check one...");
else if (lftScrn.isSelected() == false && rghtScrn.isSelected() == false)
errorField.setText("Please check one...");
else if (lftScrn.isSelected() == true && rghtScrn.isSelected() == false) {
resolution = "" + listLftRes.getValue();
startSave();
}
else if (rghtScrn.isSelected() == true && lftScrn.isSelected() == false) {
resolution = "" + listLftRes.getValue() + "" + listRgthRes.getValue();
startSave();
} else { startSave(); }
}
// Save settings to files
void startSave() throws Exception {
// XSCREENSAVER
if (useXSvrn.isSelected() == true) {
output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- /usr/lib/xscreensaver/" + xScreenVal + " -window-id WID -root";
fileWriter.write(output);
applyType = 1;
// GIF
} else if (filePathField.getText().toLowerCase().contains(".gif")) {
output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- gifview -a -w WID " + filePathField.getText();
fileWriter.write(output);
applyType = 1;
// Standard images using nitrogen
} else if(filePathField.getText().toLowerCase().contains(".jpg") ||
filePathField.getText().toLowerCase().contains(".png")) {
output = "[xin_0] \n file=" + filePathField.getText() + "\nmode=0 \nbgcolor=#000000\n" +
"[xin_1] \nfile=" + filePathField.getText() + "\nmode=0 \nbgcolor=#000000";
fileWriter.write(output);
applyType = 2;
//VIDEO
} else {
output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- mplayer -wid WID -nosound -loop 0 " + filePathField.getText();
fileWriter.write(output);
applyType = 1;
}
fileWriter.close();
}
// Run changes
@FXML void applySttngs(ActionEvent event) throws Exception {
pb = Runtime.getRuntime().exec("killall xwinwrap &");
if (applyType == 1) {
pb = Runtime.getRuntime().exec(startScrpt);
pb.waitFor();
} else if (applyType == 2) {
pb = Runtime.getRuntime().exec("nitrogen --restore");
pb.waitFor();
} else
pb = Runtime.getRuntime().exec("nitrogen --restore");
pb.waitFor();
}
// Clean selection to start new search.
@FXML void clearBttnClick(ActionEvent event) {
thumbImgView.getChildren().clear();
thumbImgView.getChildren().addAll(dirLbl);
dirPathField.setText("");
filePathField.setText("");
}
// Closes program
@FXML void closeProg(ActionEvent event) { System.exit(0); }
}

View File

@ -0,0 +1,19 @@
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
public class XWWMenu extends Application {
@Override
public void start(Stage stage) throws Exception {
Scene scene = new Scene(FXMLLoader.load(XWWMenu.class.getResource("resources/Window.fxml")));
scene.getStylesheets().add("resources/stylesheet.css");
stage.setScene(scene);
stage.setTitle("XWinWrap Menu");
stage.setResizable(false);
stage.show();
}
public static void main(String[] args) { launch(args); }
}

View File

@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
int main() {
chdir("/opt/FXWinWrap/");
system("bash launch.sh");
return 0;
}

3
src/versions/v0.0.2/launch.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
java XWWMenu

View File

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.text.*?>
<?scenebuilder-background-color 0x444444ff?>
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" style="" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="Controller">
<children>
<ScrollPane hbarPolicy="NEVER" prefHeight="345.0" prefWidth="535.0" vbarPolicy="AS_NEEDED" AnchorPane.bottomAnchor="138.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="116.07">
<content>
<VBox fx:id="thumbImgView" prefHeight="335.0" prefWidth="532.0">
<children>
<Label id="dir" fx:id="dirLbl" onMouseClicked="#setNewDir" opacity="0.5" prefHeight="330.0" prefWidth="532.0" text="Choose Image or Video Directory..." textAlignment="CENTER" textFill="#dfdfdf" textOverrun="ELLIPSIS" wrapText="true">
<font>
<Font name="System Bold" size="32.0" />
</font>
</Label>
</children>
</VBox>
</content>
</ScrollPane>
<ListView fx:id="selXScreenSvr" onMouseClicked="#passXScreenVal" prefHeight="345.93" prefWidth="158.0" AnchorPane.bottomAnchor="138.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="116.07">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="electricsheep " />
<String fx:value="atlantis" />
<String fx:value="atunnel " />
<String fx:value="blinkbox " />
<String fx:value="blocktube" />
<String fx:value="bouncingcow " />
<String fx:value="boxfit " />
<String fx:value="bsod" />
<String fx:value="bubble3d " />
<String fx:value="bumps " />
<String fx:value="cage" />
<String fx:value="carousel " />
<String fx:value="cube21 " />
<String fx:value="cubenetic" />
<String fx:value="cubicgrid " />
<String fx:value="cwaves " />
<String fx:value="dangerball" />
<String fx:value="fiberlamp " />
<String fx:value="fireworkx " />
<String fx:value="flipflop" />
<String fx:value="fliptext " />
<String fx:value="flow " />
<String fx:value="flurry" />
<String fx:value="flyingtoasters " />
<String fx:value="gflux " />
<String fx:value="glcells" />
<String fx:value="gleidescope " />
<String fx:value="glknots " />
<String fx:value="glmatrix" />
<String fx:value="glschool " />
<String fx:value="glslideshow " />
<String fx:value="glsnake" />
<String fx:value="hypertorus " />
<String fx:value="hypnowheel " />
<String fx:value="interaggregate" />
<String fx:value="intermomentary " />
<String fx:value="jigglypuff " />
<String fx:value="jigsaw" />
<String fx:value="julia " />
<String fx:value="lament " />
<String fx:value="lockward" />
<String fx:value="metaballs " />
<String fx:value="moebiusgears " />
<String fx:value="molecule" />
<String fx:value="morph3d " />
<String fx:value="noof " />
<String fx:value="phosphor" />
<String fx:value="photopile " />
<String fx:value="pinion " />
<String fx:value="popsquares" />
<String fx:value="ripples " />
<String fx:value="skytentacles " />
<String fx:value="slidescreen" />
<String fx:value="stonerview " />
<String fx:value="strange " />
<String fx:value="substrate" />
<String fx:value="tangram " />
<String fx:value="whirlwindwarp " />
<String fx:value="wormhole" />
<String fx:value="xflame " />
<String fx:value="xrayswarm " />
<String fx:value="companioncube" />
<String fx:value="fuzzyflakes " />
<String fx:value="galaxy " />
<String fx:value="glplanet" />
<String fx:value="penetrate" />
</FXCollections>
</items>
</ListView>
<Label layoutY="230.0" text="Right Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="576.5" />
<Label layoutY="497.0" text="Save Path:" AnchorPane.leftAnchor="220.0" AnchorPane.rightAnchor="660.0" />
<Label fx:id="errorField" layoutX="206.0" layoutY="481.0" prefWidth="168.0" text="" textFill="#ff3333" />
<Button id="saveBttn" layoutX="543.0" layoutY="537.0" mnemonicParsing="false" onAction="#saveToFile" prefHeight="50.0" prefWidth="169.0" text="Save Selection" />
<Button id="applyBttn" layoutX="725.0" layoutY="537.0" mnemonicParsing="false" onAction="#applySttngs" prefHeight="50.0" prefWidth="100.0" text="Apply" />
<Button id="restartBttn" layoutX="14.0" layoutY="536.0" mnemonicParsing="false" onAction="#restartXWinWrp" prefHeight="50.0" prefWidth="169.0" text="RE-Start XWinWrap" />
<Button id="killBttn" layoutX="200.0" layoutY="537.0" mnemonicParsing="false" onAction="#killXWinWrp" prefHeight="50.0" prefWidth="169.0" text="Kill XWinWrap" />
<Button fx:id="closeBttn" layoutX="838.0" layoutY="537.0" mnemonicParsing="false" onAction="#closeProg" prefHeight="50.0" prefWidth="100.0" text="Close" />
<ChoiceBox fx:id="listSaveLoc" layoutY="497.0" prefHeight="29.0" prefWidth="283.0" AnchorPane.leftAnchor="307.0" AnchorPane.rightAnchor="360.0">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value=".animatedBGstarter.sh" />
<String fx:value=".animatedBGstarter2.sh" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listRgthRes" layoutY="254.0" prefHeight="29.0" prefWidth="169.0" value="+1920+0" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="+1920+0" />
<String fx:value="+1440+0" />
<String fx:value="+1600+0" />
<String fx:value="+1280+0" />
<String fx:value="+800+0" />
</FXCollections>
</items>
</ChoiceBox>
<ChoiceBox id="listRes" fx:id="listLftRes" layoutY="149.0" prefHeight="29.0" prefWidth="169.0" value="1920x1080" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="575.5">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="1920x1080" />
<String fx:value="1440x720" />
<String fx:value="1600x900" />
<String fx:value="1280x720" />
<String fx:value="800x600" />
</FXCollections>
</items>
</ChoiceBox>
<CheckBox fx:id="lftScrn" layoutY="195.0" mnemonicParsing="false" prefWidth="114.17000000000002" selected="true" text="Left Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="rghtScrn" allowIndeterminate="false" layoutY="300.0" mnemonicParsing="false" prefWidth="114.17000000000002" text="Right Screen" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="629.5" />
<CheckBox fx:id="useXSvrn" layoutY="366.0" mnemonicParsing="false" text="Use XScreenSaver" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="603.5" />
<Label layoutY="125.0" text="Left Screen Resolutions:" AnchorPane.leftAnchor="205.5" AnchorPane.rightAnchor="586.5" />
<TextField id="txtDirPath" fx:id="filePathField" layoutX="14.0" layoutY="50.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="File Path" />
<TextField id="txtDirPath" fx:id="dirPathField" layoutX="14.0" layoutY="15.0" onKeyReleased="#onEnter" prefWidth="924.0" promptText="Directory Path" />
<Button fx:id="clear" layoutX="882.0" layoutY="85.0" mnemonicParsing="false" onAction="#clearBttnClick" text="Clear" />
<Label layoutX="14.0" layoutY="88.0" text="XScreenSaver List" />
<Label layoutX="401.0" layoutY="465.0" prefWidth="532.0" text="Note: Double click an image to view the video or image." textFill="#dfdfdf" />
</children>
</AnchorPane>

View File

@ -0,0 +1,5 @@
#!/bin/bash
### nohup is needed to keep child process alive from java's
xterm -e nohup ~/.animatedBGstarter.sh
xterm -e nohup ~/.animatedBGstarter2.sh

Binary file not shown.

View File

@ -0,0 +1,3 @@
.root {
-fx-background: rgba(68, 68, 68, 0.8); // == #444444;
}