From dc81fab796e6e7a288b5db89fda9f09d9d4a00aa Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 30 Nov 2018 15:20:29 -0500 Subject: add move-to-next-monitor --- move-to-next-monitor/README.md | 24 ++++++ move-to-next-monitor/move-to-next-monitor.Makefile | 58 ++++++++++++++ move-to-next-monitor/move-to-next-monitor.spec | 89 ++++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 move-to-next-monitor/README.md create mode 100644 move-to-next-monitor/move-to-next-monitor.Makefile create mode 100644 move-to-next-monitor/move-to-next-monitor.spec (limited to 'move-to-next-monitor') diff --git a/move-to-next-monitor/README.md b/move-to-next-monitor/README.md new file mode 100644 index 0000000..7f14b8d --- /dev/null +++ b/move-to-next-monitor/README.md @@ -0,0 +1,24 @@ +# Readme for move-to-next-monitor +To take full advantage of move-to-next-monitor, set it up on a keyboard shortcut in your display manager settings. + +A certain non-free operating system uses Super+Shift+Left and Super+Shift+Right. + +| Command | Shortcut key | +| ------------------------------ | ----------------- | +| move-to-next-monitor | Super+Shift+right | +| move-to-next-monitor --reverse | Super+Shift+left | + +### Alternatives +Alternative includes: [https://github.com/calandoa/movescreen](https://github.com/calandoa/movescreen) + +### Dependencies +Several dependencies are needed for this script to operate correctly. +* python +* wmctrl +* xdotool +* xprop +* xrandr + +### Sources +The original concept was written by [jcOOke](https://github.com/jc00ke/move-to-next-monitor). A reiteration in python was provided by [vanaoff](https://github.com/vanaoff/move-to-next-monitor). +The upstream package for this rpm is [https://gitlab.com/bgstack15/move-to-next-monitor](https://gitlab.com/bgstack15/move-to-next-monitor). diff --git a/move-to-next-monitor/move-to-next-monitor.Makefile b/move-to-next-monitor/move-to-next-monitor.Makefile new file mode 100644 index 0000000..ac896df --- /dev/null +++ b/move-to-next-monitor/move-to-next-monitor.Makefile @@ -0,0 +1,58 @@ +# File: Makefile for move-to-next-monitor +# Location: bgscripts source package +# Author: bgstack15 +# Startdate: 2018-11-30 +# Title: Makefile for move-to-next-monitor source package +# Purpose: To use traditional Unix make utility +# History: +# Usage: +# Reference: +# Improve: +# Document: +# Dependencies: + +APPNAME = move-to-next-monitor +APPVERSION = 0.0.1 +SRCDIR = $(CURDIR) +prefix = /usr +BINDIR = $(DESTDIR)$(prefix)/bin +LICENSEDIR = $(DESTDIR)$(prefix)/share/licenses/$(APPNAME) + +awkbin :=$(shell which awk) +cpbin :=$(shell which cp) +echobin :=$(shell which echo) +findbin :=$(shell which find) +grepbin :=$(shell which grep) +installbin :=$(shell which install) +rmbin :=$(shell which rm) +sedbin :=$(shell which sed) +sortbin :=$(shell which sort) +truebin :=$(shell which true) + +all: + ${echobin} "No compilation in this package." + +.PHONY: clean install install_files uninstall list + +list: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | ${awkbin} -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | ${sortbin} | ${grepbin} -E -v -e '^[^[:alnum:]]' -e '^$@$$' + +install: install_files + +install_files: + ${echobin} Installing files to ${DESTDIR} + ${installbin} -d ${BINDIR} ${LICENSEDIR} + ls -l ${SRCDIR} + ${installbin} -m '0755' ${SRCDIR}/move-to-next-monitor ${BINDIR}/ + ${installbin} -m '0644' ${SRCDIR}/LICENSE ${LICENSEDIR}/ + +uninstall: + ${echobin} SRCDIR=${SRCDIR} + ${rmbin} -f ${BINDIR}/move-to-next-monitor + ${rmbin} -f ${LICENSEDIR}/LICENSE + + # remove all installed directories that are now blank. + for word in $$( ${findbin} ${DESTDIR} -mindepth 1 -type d -printf '%p\n' | ${awkbin} '{print length, $$0 }' | ${sortbin} -rn | ${awkbin} '{print $$2}' ) ; do ${findbin} $${word} -mindepth 1 1>/dev/null 2>&1 | read 1>/dev/null 2>&1 || { rmdir "$${word}" 2>/dev/null || ${truebin} ; } ; done + +clean: + -${echobin} "target $@ not implemented yet! Gotta say unh." diff --git a/move-to-next-monitor/move-to-next-monitor.spec b/move-to-next-monitor/move-to-next-monitor.spec new file mode 100644 index 0000000..446cb0b --- /dev/null +++ b/move-to-next-monitor/move-to-next-monitor.spec @@ -0,0 +1,89 @@ +%global dummy_package 0 +%global use_git 1 +%if 0%{use_git} +%global tarballdir %{name}-master +%else +%global tarballdir %{name}-%{version} +%endif +%define license_files %{srcdir}/License.txt + +# turn off debug package +%define debug_package %{nil} + +Name: move-to-next-monitor +Version: 0.0.1 +Release: 1 +BuildArch: noarch +Summary: Script that facilitates moving a window to the next monitor + +Group: Utility +License: GPL-3.0 +URL: https://gitlab.com/bgstack15/move-to-next-monitor +%if 0%{use_git} +# Source0: https://github.com/vanaoff/move-to-next-monitor/archive/master.zip +Source0: https://gitlab.com/bgstack15/%{name}/-/archive/master/%{name}-master.tar.gz +%else +Source0: https://gitlab.com/bgstack15/%{name}/-/archive/%{version}/%{name}-master.tar.gz +%endif +Source1: move-to-next-monitor.Makefile +Source2: README.md +#Patch1: none.patch + +Packager: Bgstack15 +BuildRequires: coreutils +Requires: python3 +Requires: wmctrl +Requires: xdotool +Requires: xorg-x11-server-utils +Requires: xorg-x11-utils + +%description +move-to-next-monitor is a small script that makes it easy for display managers without this native functionality to provide it. You can assign a shortcut key in the display manager settings to the script to use it. + +%prep +%setup -q -c +# copy in custom Makefile and adjust to use tarball directory as source directory +%{__cp} -p %{SOURCE1} ./Makefile +%{__sed} -i -r -e '/^SRCDIR\s*=/s:\$\(CURDIR\)\s*$:$(CURDIR)/'"%{tarballdir}"':;' ./Makefile + +#pushd %{tarballdir} +#%patch0 -p1 +#popd + +%build +: + +%install +%make_install + +# man page +%{__mkdir_p} %{buildroot}%{_pkgdocdir} +%{__cp} -p "%{SOURCE2}" %{buildroot}%{_pkgdocdir}/ + +%clean +%{__rm} -rf %{buildroot} || : + +%post +: + +%preun +# is it a final removal? +#if test "$1" = "0" ; +#then +#fi +: + +%postun +: + +%posttrans +: + +%files +%license LICENSE +%doc %{_pkgdocdir}/* +%{_bindir}/%{name} + +%changelog +* Fri Nov 30 2018 B Stack 0.0.1-1 +- initial package built -- cgit