diff --git a/bin/v0.1-4/fxwinwrap-0-1-4-x64.deb b/bin/v0.1-4/fxwinwrap-0-1-4-x64.deb index d978444..da246f7 100644 Binary files a/bin/v0.1-4/fxwinwrap-0-1-4-x64.deb and b/bin/v0.1-4/fxwinwrap-0-1-4-x64.deb differ diff --git a/bin/v0.1-4/fxwinwrap-0-1-4-x86.deb b/bin/v0.1-4/fxwinwrap-0-1-4-x86.deb index d003487..3caee65 100644 Binary files a/bin/v0.1-4/fxwinwrap-0-1-4-x86.deb and b/bin/v0.1-4/fxwinwrap-0-1-4-x86.deb differ diff --git a/src/debs/fxwinwrap-0-1-4-x64/DEBIAN/control b/src/debs/fxwinwrap-0-1-4-x64/DEBIAN/control index 8968cc1..bd3655c 100644 --- a/src/debs/fxwinwrap-0-1-4-x64/DEBIAN/control +++ b/src/debs/fxwinwrap-0-1-4-x64/DEBIAN/control @@ -1,8 +1,8 @@ -Package: fxwinwrap +Package: fxwinwrap64 Version: 0.1-3 Section: base Priority: optional -Architecture: i386 +Architecture: amd64 Depends: openjdk-8-jre (>= 8u45-b14-1), openjfx (>= 8u60-b27-4), ffmpegthumbnailer (>= 2.0.10-0.1), mplayer2 (>=2.0-728-g2c378c7-4), gifsicle (>=1.86-1), nitrogen (>=1.5.2-2) Maintainer: Maxim Stewart 1itdominator@gmail.com Description: A GUI to handle setting XWinWrap options. diff --git a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$1.class b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$1.class index 51f4170..e29b9b2 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$1.class and b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$1.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$2.class b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$2.class index 00b2640..13d871e 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$2.class and b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$2.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$3.class b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$3.class index 2154b3b..c311c54 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$3.class and b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller$3.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller.class b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller.class index 224b714..87fcd7b 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller.class and b/src/debs/fxwinwrap-0-1-4-x64/opt/FXWinWrap/Controller.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$1.class b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$1.class index 51f4170..e29b9b2 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$1.class and b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$1.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$2.class b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$2.class index 00b2640..13d871e 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$2.class and b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$2.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$3.class b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$3.class index 2154b3b..c311c54 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$3.class and b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller$3.class differ diff --git a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller.class b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller.class index 224b714..87fcd7b 100644 Binary files a/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller.class and b/src/debs/fxwinwrap-0-1-4-x86/opt/FXWinWrap/Controller.class differ diff --git a/src/versions/v0.0.4/Controller.java b/src/versions/v0.0.4/Controller.java index 4283fe4..058b29f 100644 --- a/src/versions/v0.0.4/Controller.java +++ b/src/versions/v0.0.4/Controller.java @@ -1,4 +1,5 @@ -import javafx.stage.*; +import javafx.stage.Stage; +import javafx.stage.DirectoryChooser; import javafx.scene.Scene; import javafx.fxml.FXML; import javafx.scene.image.Image; @@ -11,12 +12,17 @@ import javafx.scene.input.KeyEvent; import javafx.scene.input.KeyCode; import javafx.scene.input.MouseEvent; import javafx.geometry.Insets; -import java.io.*; -import javafx.beans.value.ChangeListener; -import javafx.beans.value.ObservableValue; import javafx.concurrent.Task; import javafx.application.Platform; +import java.io.File; +import java.io.UncheckedIOException; +import java.io.IOException; +import java.io.FileWriter; + +import javafx.beans.value.ChangeListener; +import javafx.beans.value.ObservableValue; + public class Controller { private DirectoryChooser folderChooser = new DirectoryChooser(); // Selects a dir @@ -26,9 +32,8 @@ public class Controller { private Image pth = new Image("."); // Path to image 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 - textAreaPth = ""; + private String tmpPath, resolution, xScreenVal, output, textAreaPth = "", + startScrpt = System.getProperty("user.dir") + "/resources/bin/StartXWW.sh"; // Gets shell that starts stuff local private int applyType = 1; private Stage fileChooserStage; @FXML private ListView selXScreenSvr; @@ -36,11 +41,9 @@ public class Controller { @FXML private TilePane tilePane; @FXML private TextField dirPathField, filePathField; // Text fields @FXML private CheckBox useXSvrn; // Check boxes - @FXML private ChoiceBox playbackResolution, setMonPosOffset, listSaveLoc; // Choice box fields - @FXML private Button applyBttn, closeBttn, fileBttn, clear, // Buttons - killBttn, saveBttn; + @FXML private ChoiceBox playbackResolution, setMonPosOffset, listSaveLoc; // Choice box fields + @FXML private Button applyBttn, closeBttn, fileBttn, clear, killBttn, saveBttn; // Buttons - // This method is called by the FXMLLoader when initialization is complete @FXML void initialize() throws Exception { assert dirPathField != null : "fx:id=\"dirPathField\" was not injected: check your FXML file 'Window.fxml'."; assert clear != null : "fx:id=\"clear\" was not injected: check your FXML file 'Window.fxml'."; @@ -53,22 +56,15 @@ public class Controller { assert setMonPosOffset != null : "fx:id=\"setMonPosOffset\" was not injected: check your FXML file 'Window.fxml'."; assert playbackResolution != null : "fx:id=\"playbackResolution\" was not injected: check your FXML file 'Window.fxml'."; assert useXSvrn != null : "fx:id=\"useXSvrn\" was not injected: check your FXML file 'Window.fxml'."; - // Initialize your logic here: all @FXML variables will have been injected } - // Handler for TextArea[fx:id="dirPathField"] onKeyReleased @FXML void setNewDir(MouseEvent event) { newDir(); } @FXML void onEnter(KeyEvent event) { if (event.getCode().equals(KeyCode.ENTER)) { textAreaPth = dirPathField.getText(); System.out.println(textAreaPth); newDir(); - } - else {} - } - - @FXML void test(ActionEvent event) { - newDir(); + } else {} } // Scan selected dir @@ -82,7 +78,7 @@ public class Controller { if (directory != null) { System.out.println("Directory: " + directory); - } + } } fileList = directory.listFiles(); @@ -91,10 +87,10 @@ public class Controller { for (int i=0; i { - 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(path.toLowerCase().matches("^.*?(png|jpg|jpeg|gif).*$")) { - String title = "" + fileList[i]; - pth = new Image("file://" + fileList[i]); - ImageView view = (ImageView) (tilePane.getChildren().get(i)); + ImageView view = (ImageView) (tilePane.getChildren().get(i)); + pth = new Image("file:///tmp/image.png"); + Platform.runLater(new Runnable() { + @Override public void run() { view.setImage(pth); } + }); - Platform.runLater(new Runnable() { - @Override public void run() { - view.setImage(pth); - } - }); - final ImageView imgViewPoped = new ImageView("file://" + fileList[i]); - // image click actions - view.setOnMouseClicked(mouse -> { - if (mouse.getClickCount() == 2 && !mouse.isConsumed()) { - mouse.consume(); - displayImg(imgViewPoped, title); - } - filePathField.setText(path); - }); - } else { - System.out.println("Not a video or image file."); - } + view.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(tmpP.toLowerCase().matches("^.*?(png|jpg|jpeg|gif).*$")) { + ImageView view = (ImageView) (tilePane.getChildren().get(i)); + String title = "file://" + fileList[i]; + pth = new Image(title); + + Platform.runLater(new Runnable() { + @Override public void run() { view.setImage(pth); } + }); + + final ImageView imgViewPoped = new ImageView(title); + // image click actions + view.setOnMouseClicked(mouse -> { + if (mouse.getClickCount() == 2 && !mouse.isConsumed()) { + mouse.consume(); + displayImg(imgViewPoped, title); + } + filePathField.setText(path); + }); + } else { System.out.println("Not a video or image file."); } } } // Open image in new window @@ -199,9 +190,9 @@ public class Controller { // Saves to file with selected and needed settings if(filePathField.getText().toLowerCase().matches("^.*?(png|jpg|jpeg|gif).*$")) - sveFileLoc = new File(System.getProperty("user.home") + "/" + ".config/nitrogen/bg-saved.cfg"); + sveFileLoc = new File(System.getProperty("user.home") + "/" + ".config/nitrogen/bg-saved.cfg"); else - sveFileLoc = new File(System.getProperty("user.home") + "/" + listSaveLoc.getValue()); + sveFileLoc = new File(System.getProperty("user.home") + "/" + listSaveLoc.getValue()); fileWriter = new FileWriter(sveFileLoc); resolution = "" + playbackResolution.getValue() + "" + setMonPosOffset.getValue(); @@ -216,21 +207,21 @@ public class Controller { 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 + 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 + 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 -really-quiet -nosound -loop 0 " + filePathField.getText(); - fileWriter.write(output); - applyType = 1; + output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- mplayer -wid WID -really-quiet -ao null -loop 0 " + filePathField.getText(); + fileWriter.write(output); + applyType = 1; } fileWriter.close(); }