diff --git a/util/Makefile.am b/util/Makefile.am index 82e4831c..2ca67613 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -5,7 +5,8 @@ pkgdatadir = $(datadir)/@PACKAGE@ bin_PROGRAMS = wxcopy wxpaste wdwrite wdread getstyle setstyle seticons geticonset wmsetbg wmsetup wmagnify -bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont wmchlocale wkdemenu.pl +bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont wmchlocale wkdemenu.pl\ + wcopy wpaste EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wsetfont directjpeg.c \ wkdemenu.pl wmchlocale.in diff --git a/util/README b/util/README index c57a5c8b..7440309c 100644 --- a/util/README +++ b/util/README @@ -22,6 +22,8 @@ wxcopy- copy input file or stdin into X cutbuffer wxpaste- copy content of X cutbuffer into stdout +wcopy, wpaste- see 'man wcopy' + wmsetbg- set the workspace background into a image and make it persist between sessions. diff --git a/util/wcopy b/util/wcopy new file mode 100755 index 00000000..b0618d3b --- /dev/null +++ b/util/wcopy @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Provide some enhancements to the wxcopy command, which copies standard input +# to an X11 clipboard text buffer. +# +# Allow copying from stdin to any of the cutbuffers. Note that they are +# indexed counting from 0. +# +# Author: Luke Kendall +# + +if [ $# = 0 ] +then + wxcopy $WXCOPY_DEFS +else + MYNAME=`basename $0` + USAGE="usage: $MYNAME [ [0-9]... ] [wxcopy's args]" + for n + do + if expr "x$n" : 'x[0-9][0-9]*$' > /dev/null + then + NUMARGS="$NUMARGS $n" + elif [ "x$n" = "x-h" ] + then + echo "$USAGE" >&2 + exit 0 + else + WXARGS="$WXARGS $n" + fi + done + set - $NUMARGS + wxcopy $WXCOPY_DEFS $WXARGS -cutbuffer $1 + ORIG="$1" + shift + for n + do + wxpaste -cutbuffer $ORIG | wxcopy $WXCOPY_DEFS $WXARGS -cutbuffer $n + done +fi diff --git a/util/wmaker.inst.in b/util/wmaker.inst.in index 98b67257..ed07d782 100644 --- a/util/wmaker.inst.in +++ b/util/wmaker.inst.in @@ -72,14 +72,8 @@ copy() { source=$GLOBALDIR/plmenu.${LOCALE%.*} elif [ -f $GLOBALDIR/plmenu.${LOCALE%_*} ]; then source=$GLOBALDIR/plmenu.${LOCALE%_*} - if [ -f $GLOBALDIR/plmenu.${LOCALE%_*.*} ]; then - source=$GLOBALDIR/plmenu.${LOCALE%_*.*} - elif [ -f $GLOBALDIR/menu.${LOCALE} ]; then - source=$GLOBALDIR/menu.${LOCALE} elif [ -f $GLOBALDIR/menu.${LOCALE%_*} ]; then source=$GLOBALDIR/menu.${LOCALE%_*} - elif [ -f $GLOBALDIR/menu.${LOCALE%_*.*} ]; then - source=$GLOBALDIR/menu.${LOCALE%_*.*} else source=$GLOBALDIR/plmenu fi diff --git a/util/wpaste b/util/wpaste new file mode 100755 index 00000000..88a85507 --- /dev/null +++ b/util/wpaste @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Provide some enhancements to the wxpaste command, which pastes from X11 +# clipboard text buffers to standard output. +# +# Allow pasting to stdout from any of the cutbuffers. Note that they are +# indexed counting from 0. +# +# Author: Luke Kendall +# + +if [ $# = 0 ] +then + wxpaste $WXPASTE_DEFS +else + MYNAME=`basename $0` + USAGE="usage: $MYNAME [ [0-9]... ] [wxpaste's args]" + for n + do + if expr "x$n" : 'x[0-9][0-9]*$' > /dev/null + then + NUMARGS="$NUMARGS $n" + elif [ "x$n" = "x-h" ] + then + echo "$USAGE" >&2 + exit 0 + else + WXARGS="$WXARGS $n" + fi + done + set - $NUMARGS + for n + do + wxpaste $WXPASTE_DEFS $WXARGS -cutbuffer $n + done +fi