add license notice to all the scripts

This commit is contained in:
speedie 2023-06-03 15:19:29 +02:00
parent d5ca4510a0
commit 945de3988f
17 changed files with 64 additions and 3 deletions

View file

@ -1,3 +1,6 @@
# spmenu example scripts
This folder contains spmenu example scripts which may be used to learn how to do certain things in spmenu. They are not installed automatically, but feel free to copy the scripts somewhere and use them to learn.
This folder contains spmenu example scripts which may be used to learn how to
do certain things in spmenu. They are not installed automatically, but feel
free to copy the scripts somewhere and use them to learn. The `install.sh`
script does this for you if you want all of them.

View file

@ -1,3 +1,7 @@
#!/bin/sh
# install.sh
# Install all scripts in the current directory.
#
# See LICENSE file for copyright and license details.
[ "$(id -u)" != "0" ] && printf "Run me as root.\n" && exit 1
cp -f spmenu* /usr/bin

View file

@ -1,2 +1,8 @@
#!/bin/sh
# spmenu_16cols.sh
# Prints 16 foreground and 16 background colors
#
# See LICENSE file for copyright and license details.
printf "\033[0;31mItem 1\n\033[0;32mItem 2\n\033[0;33mItem 3\n\033[0;34mItem 4\n\033[0;35mItem 5\n\033[0;36mItem 6\n\033[0;37mItem 7\n\033[0;38mItem 8\n\033[1;31mItem 9\n\033[1;32mItem 10\n\033[1;33mItem 11\n\033[1;34mItem 12\n\033[1;35mItem 13\n\033[1;36mItem 14\n\033[1;37mItem 15\n\033[1;38mItem 16\n\
\033[0;41mItem 1\n\033[0;42mItem 2\n\033[0;43mItem 3\n\033[0;44mItem 4\n\033[0;45mItem 5\n\033[0;46mItem 6\n\033[0;47mItem 7\n\033[0;48mItem 8\n\033[1;41mItem 9\n\033[1;42mItem 10\n\033[1;43mItem 11\n\033[1;44mItem 12\n\033[1;45mItem 13\n\033[1;46mItem 14\n\033[1;47mItem 15\n\033[1;48mItem 16\n" | spmenu "$@"

View file

@ -1,6 +1,9 @@
#!/bin/sh
# proof of concept script allowing you to view images in spmenu
# usage: spmenu_imageviewer.sh image1 image2 ...
# spmenu_imageviewer.sh
# Proof of concept script allowing you to view images in spmenu
# Usage: spmenu_imageviewer.sh image1 image2 ...
#
# See LICENSE file for copyright and license details.
[ ! -f "$1" ] && printf "You must specify an image to view.\n" && exit 1
genlist() {

View file

@ -1,4 +1,8 @@
#!/bin/sh
# spmenu_itemcounter.sh
# Example script which adds a new entry to spmenu every second.
#
# See LICENSE file for copyright and license details.
func() {
rm -f /tmp/fl

View file

@ -3,6 +3,8 @@
#
# This script lists out songs in a path you give to it and also displays the cover art for that song if it can be found.
# It serves as an example of how image drawing can be done with spmenu.
#
# See LICENSE file for copyright and license details.
[ -z "$dir" ] && dir="$1"
[ -z "$maxcount" ] && maxcount="$2"
[ -z "$startline" ] && startline="$3"

View file

@ -1,4 +1,9 @@
#!/bin/sh
# spmenu_sweden.sh
# Just the swedish flag using SGR sequences, serves as a good example on how to do background colors.
#
# See LICENSE file for copyright and license details.
[ -z "$fg_blue" ] && fg_blue='\033[1;34m'
[ -z "$fg_yellow" ] && fg_yellow='\033[1;35m'
[ -z "$bg_blue" ] && bg_blue='\033[1;44m'

View file

@ -1,5 +1,6 @@
#!/bin/bash
# spmenu build script
# See LICENSE file for copyright and license details.
warn="${warn:-true}"
reconfigure="${reconfigure:-true}"
version="${version:-1.1}"

View file

@ -1,4 +1,6 @@
#!/bin/sh
# clean.sh
# See LICENSE file for copyright and license details.
rm -f \
*.zst* \
*.tar* \

View file

@ -1,2 +1,6 @@
#!/bin/sh
# generate-argument-list.sh
# Generates a list of arguments from spmenu -h output.
#
# See LICENSE file for copyright and license details.
spmenu -h | grep -vE -- "- |spmenu:" | sed "s/<//g; s/>/ /g; /^[[:space:]]*$/d"

View file

@ -1,4 +1,8 @@
#!/bin/sh
# generate-code-docs.sh
# Generate code documentation from code-docs.md
#
# See LICENSE file for copyright and license details.
version="$(grep "version : '" meson.build | awk '{ print $3 }' | sed "s/'\"//g; s/\"',//g")"
[ ! -f "$1" ] && printf "You must specify an input file.\n" && exit 1
[ -z "$2" ] && printf "You must specify an output file.\n" && exit 1

View file

@ -1,4 +1,8 @@
#!/bin/sh
# generate-docs.sh
# Generate documentation from docs.md
#
# See LICENSE file for copyright and license details.
[ ! -f spmenu.c ] && printf "You're probably in the wrong directory.\n" && exit 1
version="$(grep "version : '" meson.build | awk '{ print $3 }' | sed "s/'\"//g; s/\"',//g")"
printf "%% spmenu(1) ${version} | fancy dynamic menu\n" > .man.md

View file

@ -1,5 +1,10 @@
#!/bin/sh
# generate-headers.h
# Generate headers using wayland-scanner
#
# See LICENSE file for copyright and license details.
[ ! -x "$(command -v wayland-scanner)" ] && exit 1
wayland-scanner \
client-header \
protocols/wlr-layer-shell-unstable-v1.xml \

View file

@ -1,4 +1,8 @@
#!/bin/sh
# generate-keybind-list.sh
# Generates a keybind list in Markdown column format
#
# See LICENSE file for copyright and license details.
grep "{ " "$1" | \
grep -v "[*]" | \
sed "s/{.i = //g; s/{.c = //g; s/{.f = //g; s/{0} }/0/g; s/ } }//g; s/,//g; s/{ //g; s/^\s*//g; s/XK_//g; s/|/+/g" \

View file

@ -1,4 +1,8 @@
#!/bin/sh
# generate-pacman-pkg.sh
# Generate spmenu package for Arch and Pacman
#
# See LICENSE file for copyright and license details.
[ ! -f spmenu.c ] && printf "You're probably in the wrong directory.\n" && exit 1
version="$(grep "version : '" meson.build | awk '{ print $3 }' | sed "s/'\"//g; s/\"',//g")"

View file

@ -1,4 +1,8 @@
#!/bin/sh
# generate-pkg.sh
# Generate a spmenu tarball
#
# See LICENSE file for copyright and license details.
[ ! -f spmenu.c ] && printf "You're probably in the wrong directory.\n" && exit 1
version="$(grep "version : '" meson.build | awk '{ print $3 }' | sed "s/'\"//g; s/\"',//g")"

View file

@ -1,6 +1,8 @@
#!/bin/bash
# generate-theme.sh
# Generate a theme from a list of colors
#
# See LICENSE file for copyright and license details.
declare -a color