Added two new modules for displaying backdrops, fixed lib path(again), moved modules to subdirectory, and updated MODULES.md with useful info! ^^

This commit is contained in:
reddsik
2017-07-15 23:07:12 +02:00
parent a6b29a59ba
commit a6cbde4cd7
9 changed files with 56 additions and 17 deletions

6
Background_resize Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
if [ "$3" = "0x00000000" ]; then
display -window root $4 > /dev/null
else
display -window "$3" $4 > /dev/null
fi

6
Background_stretch Executable file
View File

@@ -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

View File

@@ -1,16 +1,37 @@
## 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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
#!/bin/ksh
#!/bin/sh
# AmiWM startup script
xrdb $OPENWINHOME/lib/Xdefaults # Load Default X11 resource database

View File

@@ -1,4 +1,4 @@
#!/bin/ksh
#!/bin/sh
if [ -z "$SESSIONTYPE" ]
then

View File

@@ -1,4 +1,4 @@
#!/bin/ksh
#!/bin/sh
unset SDT_ALT_SESSION
unset SDT_ALT_HELLO

4
rc.c
View File

@@ -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;

View File

@@ -1 +1 @@
#define VERSION "0.22"
#define VERSION "0.22_01"