diff --git a/Background_resize b/Background_resize new file mode 100755 index 0000000..9a630cb --- /dev/null +++ b/Background_resize @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$3" = "0x00000000" ]; then + display -window root $4 > /dev/null +else + display -window "$3" $4 > /dev/null +fi diff --git a/Background_stretch b/Background_stretch new file mode 100755 index 0000000..c7aef3b --- /dev/null +++ b/Background_stretch @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$3" = "0x00000000" ]; then + display -resize $(xwininfo -root | grep geometry | sed -s "s/-geometry //" | sed -s "s/+0+0//")\! -window root "$4" > /dev/null +else + display -resize $(xwininfo -root | grep geometry | sed -s "s/-geometry //" | sed -s "s/+0+0//")\! -window "$3" "$4" > /dev/null +fi diff --git a/MODULES.md b/MODULES.md index 5f476e3..b6d82d9 100644 --- a/MODULES.md +++ b/MODULES.md @@ -1,20 +1,41 @@ ## Background module -To get background images on your screens, use the Background module. -The Module command should come after the Screen command, and the -initstring should be the filename of the picture. Example: +To get background images (aka backdrops) on your screens, +use the Background module. The Module command should come +after the Screen command, and the initstring should be the +filename of the picture. Example: -Screen "My Screen" +Screen "Workbench Screen" Module "Background" "~/megumin.png" The Background module is really a shell script that requires the program 'display' from imagemagick package. Currently, it doesn't support any standard imagemagick parameters. +## Background_stretch module + +Same as the Background module, but stretches your backdrop to size of +your screen. Example: + +Screen "Workbench Screen" +Module "Background_stretch" "~/megumin.png" + +Please note that this module will just stretch or downscale the image +(depending on the size of the image) to your display ratio. +If you don't want your image to look ugly, try the next module.. + +## Background_resize module + +Same as the Background_stretch, but it cares about your display ratio. +For example, if you've got a 16:9 screen but your backdrop image is +4:3, it will get stretched, but it will still be displayed as a 4:3 +picture. The remaining part of the screen will be used to show the same +image, but repeated. + ## Keyboard module With the Keyboard module, you can bind window manager functions to keys -on the keyboard. The initstring should consist of keybindings on the +on the keyboard. The initstring should consist of keybindings on the form modifiers:where:func diff --git a/Makefile.in b/Makefile.in index 95ef42e..9127d5d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -24,7 +24,7 @@ STRIPFLAG = -s PROGS = amiwm requestchoice executecmd ppmtoinfo config_util -MODULES = $(srcdir)/Background Keyboard +MODULES = $(srcdir)/Background $(srcdir)/Keyboard $(srcdir)/Background_resize OBJS = main.o screen.o client.o frame.o icc.o \ icon.o menu.o diskobject.o gram.o lex.o rc.o \ @@ -39,13 +39,13 @@ SRCS = main.c screen.c client.c frame.c icc.c \ DISTFILES = README README.modules INSTALL LICENSE amiwm.1 \ configure configure.in Makefile.in install-sh smakefile scoptions \ *.[chly] system.amiwmrc def_*.info *.map \ - Background Xresources.amiwm.in Amilogo.?m Xsession*.in Xinitrc.in \ - amiwm-init libami/Makefile.in libami/*.[chly] + Background Background_resize Xresources.amiwm.in Amilogo.?m \ + Xsession*.in Xinitrc.in amiwm-init libami/Makefile.in libami/*.[chly] \ PACKAGENAME = amiwm AMIWM_HOME = $(libdir)/amiwm -AMIWM_LIBS = /lib/amiwm +AMIWM_MODULES = $(libdir)/amiwm/modules all : lib_all @$(MAKE) local_all @@ -91,15 +91,19 @@ kbdlexer.c : kbdlexer.l install : $(PROGS) $(MODULES) Xsession Xsession2 Xinitrc amiwm-init -mkdir -p $(AMIWM_HOME) - -mkdir -p $(AMIWM_LIBS) + -mkdir -p $(AMIWM_MODULES) $(INSTALL) $(STRIPFLAG) requestchoice $(AMIWM_HOME)/requestchoice $(INSTALL) $(STRIPFLAG) config_util $(AMIWM_HOME)/config_util $(INSTALL) $(STRIPFLAG) executecmd $(AMIWM_HOME)/executecmd for module in $(MODULES); do \ if [ "$$module" = "$(srcdir)/Background" ]; then \ - $(INSTALL) $$module $(AMIWM_LIBS)/Background; \ + $(INSTALL) $$module $(AMIWM_MODULES)/Background; \ else \ - $(INSTALL) $(STRIPFLAG) $$module $(AMIWM_LIBS)/$$module; \ + if [ "$$module" = "$(srcdir)/Background_resize" ]; then \ + $(INSTALL) $$module $(AMIWM_MODULES)/Background_resize; \ + else \ + $(INSTALL) $(STRIPFLAG) $$module $(AMIWM_MODULES)/$$module; \ + fi; \ fi; \ done $(INSTALL) -m 644 $(srcdir)/system.amiwmrc $(AMIWM_HOME)/system.amiwmrc diff --git a/Xinitrc.in b/Xinitrc.in index 5702fa6..8a9eadd 100644 --- a/Xinitrc.in +++ b/Xinitrc.in @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/sh # AmiWM startup script xrdb $OPENWINHOME/lib/Xdefaults # Load Default X11 resource database diff --git a/Xsession.in b/Xsession.in index ab6cf40..fd35985 100644 --- a/Xsession.in +++ b/Xsession.in @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/sh if [ -z "$SESSIONTYPE" ] then diff --git a/Xsession2.in b/Xsession2.in index a5e6481..e1d801d 100644 --- a/Xsession2.in +++ b/Xsession2.in @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/sh unset SDT_ALT_SESSION unset SDT_ALT_HELLO diff --git a/rc.c b/rc.c index 73215fe..ca24166 100644 --- a/rc.c +++ b/rc.c @@ -25,6 +25,8 @@ struct prefs_struct prefs; #define RC_FILENAME ".amiwmrc" #endif +#define AMIWM_MODULES AMIWM_HOME"/modules/" + FILE *rcfile; int ParseError=0; @@ -36,7 +38,7 @@ void read_rc_file(char *filename, int manage_all) prefs.manage_all = manage_all; prefs.sizeborder=Psizeright; prefs.icondir=AMIWM_HOME; - prefs.module_path=AMIWM_HOME; + prefs.module_path=AMIWM_MODULES; prefs.defaulticon="def_tool.info"; prefs.borderwidth=1; prefs.titleclockinterval=1; diff --git a/version.h b/version.h index 1562106..a711b63 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION "0.22" +#define VERSION "0.22_01"