summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/newpass2
-rwxr-xr-xbin/rst2html3
-rwxr-xr-xbin/rst2latex3
-rwxr-xr-xbin/set-screen58
-rwxr-xr-xbin/vbox-mods2
5 files changed, 68 insertions, 0 deletions
diff --git a/bin/newpass b/bin/newpass
new file mode 100755
index 0000000..c17f259
--- /dev/null
+++ b/bin/newpass
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec apg -k -a 1 -n 10 -m 8 -x 20 -M SNCL
diff --git a/bin/rst2html b/bin/rst2html
new file mode 100755
index 0000000..511ac6d
--- /dev/null
+++ b/bin/rst2html
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec rst2html.py --stylesheet-path /usr/share/doc/docutils-*/html/html4css1.css --embed-stylesheet "$@"
diff --git a/bin/rst2latex b/bin/rst2latex
new file mode 100755
index 0000000..6ea2d27
--- /dev/null
+++ b/bin/rst2latex
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /home/dakkar/src/ReST/docutils-0.3.7/tools/rst2latex.py --language=it --documentoptions=a4paper,12pt --use-latex-footnotes --use-latex-toc "$@"
diff --git a/bin/set-screen b/bin/set-screen
new file mode 100755
index 0000000..49556e2
--- /dev/null
+++ b/bin/set-screen
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+CONFIG_DIR="${HOME}/.config/set-screen"
+
+function get_display_state_hash() {
+ local hash etc
+ read hash etc < <(
+ for i in /sys/class/drm/card*/card*-*; do
+ echo $i
+ cat $i/status
+ cat $i/edid
+ done | sha1sum -b)
+ echo "$hash"
+}
+
+function display_state_dir() {
+ local hash
+ hash="$(get_display_state_hash)"
+ echo "${CONFIG_DIR}/$hash"
+}
+
+function make_display_state_dir() {
+ local dir
+ dir="$(display_state_dir)"
+ mkdir -p "$dir"
+ echo "Created $dir"
+}
+
+function run_display_state_commands() {
+ local dir
+ dir="$(display_state_dir)"
+
+ if [[ -x "${dir}/command" ]]; then
+ "${dir}/command"
+ if [[ -x "${CONFIG_DIR}/post-command" ]]; then
+ "${CONFIG_DIR}/post-command"
+ fi
+ fi
+}
+
+function print_usage() {
+ cat <<EOF
+$0 -- re-configure screens
+
+Usage:
+ $0 make create directory for current state
+ $0 set execute 'command' script in directory for current state
+ $0 same as 'set'
+ $0 help show this text
+EOF
+}
+
+case "$1" in
+ 'make') make_display_state_dir ;;
+ '' | 'set') run_display_state_commands ;;
+ 'help' | '--help' ) print_usage ; exit 0 ;;
+ *) >&2 print_usage; exit 1 ;;
+esac
diff --git a/bin/vbox-mods b/bin/vbox-mods
new file mode 100755
index 0000000..3796669
--- /dev/null
+++ b/bin/vbox-mods
@@ -0,0 +1,2 @@
+#!/bin/sh
+for m in vbox{drv,netadp,netflt}; do sudo modprobe $m; done