more code

This commit is contained in:
tth 2020-11-24 00:40:57 +01:00
parent d7626104d4
commit 4f82cc967b
3 changed files with 54 additions and 0 deletions

12
code/Makefile Normal file
View File

@ -0,0 +1,12 @@
######################################################
# TetaTricks
#
# exemples du bouquin
ex_curses: ex_curses.c Makefile
gcc -Wall $< -o $@ -lncurses
thread-demo: thread-demo.c Makefile
gcc -Wall -pthread $< -o $@

16
code/move-xlogo.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
xlogo &
sleep 1
job=$! ; echo "job = " $job
WIN=$(xdotool search -name 'xlogo')
echo "win = " $WIN
for foo in $(seq 10 33 900)
do
sleep 1
xdotool windowmove $WIN 50 $foo
done
kill $job

26
code/tagpic.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
function tagpic
{
infile="$1"
outfile="$2"
texte="$3"
txtfont=" -font Utopia "
fontsize=" -pointsize 96 -kerning 4 "
color=" -fill Gray20 -stroke White "
txtopts=" -antialias -alpha off $txtfont "
convert $infile \
${txtopts} \
${txtfont} ${fontsize} \
${color} \
-gravity South \
-annotate +0+85 "${texte}" \
$outfile
}
if [ "$#" -eq 1 ] ; then
tagpic foo.png bar.png "$1"
display bar.png
fi