summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-04-18 20:58:09 +0200
committerAnton Khirnov <wyskas@gmail.com>2009-04-18 20:58:09 +0200
commit92560cc8670c613b298ca6db9017d1097f7611c5 (patch)
tree7a7905711db521f44da02c6da586d0ef213b1537 /scripts
initial commit
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/clean.sh18
-rwxr-xr-xscripts/kde_colors82
-rwxr-xr-xscripts/kde_colors_have_changed26
-rwxr-xr-xscripts/menu_colorset.sh10
-rwxr-xr-xscripts/menu_decoration.sh10
-rwxr-xr-xscripts/menu_fonttheme.sh10
-rwxr-xr-xscripts/miau.sh17
-rwxr-xr-xscripts/midclick_menu.sh21
-rwxr-xr-xscripts/panel_thumbnailer.sh53
-rwxr-xr-xscripts/random_wallpaper.sh14
-rwxr-xr-xscripts/traffic.sh11
11 files changed, 272 insertions, 0 deletions
diff --git a/scripts/clean.sh b/scripts/clean.sh
new file mode 100755
index 0000000..6f4a3ae
--- /dev/null
+++ b/scripts/clean.sh
@@ -0,0 +1,18 @@
+cd ${FVWM_USERDIR} || cd ~/.fvwm/ || exit 0
+
+# Clean links and stuff, raw configuration
+echo Cleaning links, for a raw configuration.
+rm -f $(find ${FVWM_USERDIR} -type l)
+
+# Clean some temporal crap and backups
+echo Cleaning some temporal crap and backups.
+find ${FVWM_USERDIR} -name "*~" -exec rm -f '{}' \;
+find ${FVWM_USERDIR} -name "*.rej" -exec rm -f '{}' \;
+find ${FVWM_USERDIR} -name "*.orig" -exec rm -f '{}' \;
+find ${FVWM_USERDIR} -name "*.save" -exec rm -f '{}' \;
+find ${FVWM_USERDIR} -name "magick*" -exec rm -f '{}' \;
+find ${FVWM_USERDIR} -name ".dolphinview" -exec rm -f '{}' \;
+rm -f ${FVWM_USERDIR}/.FvwmConsole-History
+rm -f ${FVWM_USERDIR}/FvwmCommand-*
+rm -f ${FVWM_USERDIR}/tmp/*
+echo
diff --git a/scripts/kde_colors b/scripts/kde_colors
new file mode 100755
index 0000000..6bf988c
--- /dev/null
+++ b/scripts/kde_colors
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+COLORS_FILE="$(grep kcsrc ${HOME}/.kde/share/config/kdeglobals)"
+COLORS_FILE="${HOME}/.kde/share/apps/kdisplay/color-schemes/${COLORS_FILE/colorScheme=/}"
+echo "SetEnv kde_colors_file \"${COLORS_FILE}\""
+
+echo "UnsetEnv activeBackground"
+echo "UnsetEnv activeBlend"
+echo "UnsetEnv activeForeground"
+echo "UnsetEnv activeTitleBtnBg"
+echo "UnsetEnv alternateBackground"
+echo "UnsetEnv background"
+echo "UnsetEnv buttonBackground"
+echo "UnsetEnv buttonForeground"
+echo "UnsetEnv foreground"
+echo "UnsetEnv frame"
+echo "UnsetEnv handle"
+echo "UnsetEnv inactiveBackground"
+echo "UnsetEnv inactiveBlend"
+echo "UnsetEnv inactiveForeground"
+echo "UnsetEnv inactiveFrame"
+echo "UnsetEnv inactiveHandle"
+echo "UnsetEnv inactiveTitleBtnBg"
+echo "UnsetEnv linkColor"
+echo "UnsetEnv selectBackground"
+echo "UnsetEnv selectForeground"
+echo "UnsetEnv visitedLinkColor"
+echo "UnsetEnv windowBackground"
+echo "UnsetEnv windowForeground"
+
+[ -d "$COLORS_FILE" ] && \
+{
+ echo "#Predeterminado de KDE, seteando colores preconfigurados..."
+ echo "SetEnv activeBackground #418EDC"
+ echo "SetEnv activeBlend #6B91B8"
+ echo "SetEnv activeForeground #FFFFFF"
+ echo "SetEnv activeTitleBtnBg #DCDCDC"
+ echo "SetEnv alternateBackground #EDF4F9"
+ echo "SetEnv background #EFEFEF"
+ echo "SetEnv buttonBackground #DDDFE4"
+ echo "SetEnv buttonForeground #000000"
+ echo "SetEnv foreground #000000"
+ echo "SetEnv frame #EFEFEF"
+ echo "SetEnv handle #EFEFEF"
+ echo "SetEnv inactiveBackground #9DAABA"
+ echo "SetEnv inactiveBlend #9DAABA"
+ echo "SetEnv inactiveForeground #DDDDDD"
+ echo "SetEnv inactiveFrame #EFEFEF"
+ echo "SetEnv inactiveHandle #EFEFEF"
+ echo "SetEnv inactiveTitleBtnBg #DCDCDC"
+ echo "SetEnv linkColor #0000EE"
+ echo "SetEnv selectBackground #678DB2"
+ echo "SetEnv selectForeground #FFFFFF"
+ echo "SetEnv visitedLinkColor #52188B"
+ echo "SetEnv windowBackground #FFFFFF"
+ echo "SetEnv windowForeground #000000"
+} || \
+awk '
+ BEGIN {
+ FS="="
+ }
+ /^\[/ { next }
+ /^Name/ { next }
+ /^# KDE/ {next }
+ /\,/ && !/\#/ {
+ FS="="
+ n=split($2,dec,",")
+ if ( n == 3)
+ {
+ printf("%s %s #","SetEnv",$1)
+ for(i=1;i<=n;i++)
+ {
+ printf("%02X",dec[i])
+ }
+ printf("\n")
+ }
+ }
+ !/\,/ && /\#/ {
+ FS="="
+ printf("%s %s %s\n","SetEnv",$1,$2)
+ }' \
+ "$COLORS_FILE"
diff --git a/scripts/kde_colors_have_changed b/scripts/kde_colors_have_changed
new file mode 100755
index 0000000..cbc3405
--- /dev/null
+++ b/scripts/kde_colors_have_changed
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+COLORS_FILE="$(grep kcsrc ${HOME}/.kde/share/config/kdeglobals)"
+COLORS_FILE="${HOME}/.kde/share/apps/kdisplay/color-schemes/${COLORS_FILE/colorScheme=/}"
+kde_new_colors_file="$COLORS_FILE"
+
+test_change_colors() {
+
+ echo "kde_colors_file = $kde_colors_file"
+ echo "kde_new_colors_file = $kde_new_colors_file"
+
+ if [ ! "${kde_new_colors_file}" == "${kde_colors_file}" ]
+ then
+ {
+ FvwmCommand Restart
+ }
+ fi
+ return 0
+}
+
+inotifywait -m -e moved_to "${HOME}/.kde/share/config/kdeglobals" | \
+while read
+do
+# test_change_colors
+ FvwmCommand Restart
+done
diff --git a/scripts/menu_colorset.sh b/scripts/menu_colorset.sh
new file mode 100755
index 0000000..fab3d36
--- /dev/null
+++ b/scripts/menu_colorset.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Note to self:
+# Make sure that no output is send to stdout
+# only stuff that fvwm can digest is allowed
+# Just echo the rest with \# in front of the line
+
+for i in ${FVWM_USERDIR}/colorsets/*.cs
+do
+ echo "+ \"\&$(basename "${i%.cs}")\" ChangeColorset \"${i}\""
+done
diff --git a/scripts/menu_decoration.sh b/scripts/menu_decoration.sh
new file mode 100755
index 0000000..cde9e84
--- /dev/null
+++ b/scripts/menu_decoration.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Note to self:
+# Make sure that no output is send to stdout
+# only stuff that fvwm can digest is allowed
+# Just echo the rest with \# in front of the line
+
+for i in ${FVWM_USERDIR}/decorations/*.deco
+do
+ echo "+ \"\&$(basename "${i%.deco}")\" ChangeDecoration \"${i}\""
+done
diff --git a/scripts/menu_fonttheme.sh b/scripts/menu_fonttheme.sh
new file mode 100755
index 0000000..1b51bc2
--- /dev/null
+++ b/scripts/menu_fonttheme.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Note to self:
+# Make sure that no output is send to stdout
+# only stuff that fvwm can digest is allowed
+# Just echo the rest with \# in front of the line
+
+for i in ${FVWM_USERDIR}/fontthemes/*.ft
+do
+ echo "+ \"\&$(basename "${i%.ft}")\" ChangeFonttheme \"${i}\""
+done
diff --git a/scripts/miau.sh b/scripts/miau.sh
new file mode 100755
index 0000000..b20075e
--- /dev/null
+++ b/scripts/miau.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+sonidos="${FVWM_USERDIR}/cats/"
+
+MSG=$(fortune)
+#kdialog --passivepopup "$MSG"
+notify-send --icon="${FVWM_USERDIR}/images/gato_icon.png" --expire-time=25000 "$MSG"
+
+if [[ -d "${sonidos}" ]]
+then
+ files=$(ls "${sonidos}")
+ file_matrix=($files)
+ num_files=${#file_matrix[*]}
+ play "${sonidos}/${file_matrix[$((RANDOM%num_files))]}"
+fi
+
+exit 0
diff --git a/scripts/midclick_menu.sh b/scripts/midclick_menu.sh
new file mode 100755
index 0000000..c394223
--- /dev/null
+++ b/scripts/midclick_menu.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#i=$(cat ${FVWM_USERDIR}/config-options/desktop_size)
+i=1x$[pages]
+j=${i}
+
+i=${i%x*}
+j=${j#*x}
+
+a=0
+b=0
+
+while [[ ${a} -lt ${i} ]]
+do
+ while [[ ${b} -lt ${j} ]]
+ do
+ echo + "\"${@} $a,$b\"" Pick MoveToPage $a $b
+ b=$((${b} + 1))
+ done
+ a=$((${a} + 1))
+ b=0
+done
diff --git a/scripts/panel_thumbnailer.sh b/scripts/panel_thumbnailer.sh
new file mode 100755
index 0000000..8da8a37
--- /dev/null
+++ b/scripts/panel_thumbnailer.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Note to self:
+# Make sure that no output is send to stdout
+# only stuff that fvwm can digest is allowed
+# Just echo the rest with \# in front of the line
+
+# Wallpaper directory as a variable makes it more flexible ;-)
+# This var is read now in initVars.config
+DEBUG=1
+test ! -d "${WALLPAPERDIR}/.thumbs" \
+ && mkdir -p "${WALLPAPERDIR}/.thumbs"
+
+x=$((${width} / 10))
+y=$((${height} / 10))
+
+menuthumbsize="${x}x${y}"
+
+for i in \
+ ${WALLPAPERDIR}/*.jpg \
+ ${WALLPAPERDIR}/*.png \
+ ${WALLPAPERDIR}/*.gif
+do \
+ if [[ ! -f "${i}" ]]; then continue; fi
+ if [[ -f "${WALLPAPERDIR}/.thumbs/$(basename ${i}.png)" ]]
+ then
+ i_size=$(identify -verbose "${WALLPAPERDIR}/.thumbs/$(basename ${i}.png)" \
+ | grep Geometry | sed -e 's/ Geometry: //' | sed -e 's/+.*+.*//')
+ else
+ i_size=0x0
+ fi
+ [ "$DEBUG" == "1" ] && echo "#"
+ [ "$DEBUG" == "1" ] && echo "# $i"
+ [ "$DEBUG" == "1" ] && echo "# Image size = \"${i_size}\", wanted size = \"${menuthumbsize}\""
+ if [[ ! "${menuthumbsize}" == "${i_size}" ]]
+ then
+ [ "$DEBUG" == "1" ] && echo "# Thumbnailing: ${i} ..."
+ convert -scale ${menuthumbsize}! "${i}" "png:${WALLPAPERDIR}/.thumbs/$(basename ${i}).png"
+ fi
+done || (echo error && exit 1)
+
+for i in \
+ ${WALLPAPERDIR}/*.jpg \
+ ${WALLPAPERDIR}/*.png \
+ ${WALLPAPERDIR}/*.gif
+do \
+ if [[ ! -f "${i}" ]]; then continue; fi
+ [ "$DEBUG" == "1" ] && echo "#"
+ echo "*FvwmWallpaperChanger: (Title \"$(basename ${i})\", Icon \"${WALLPAPERDIR}/.thumbs/$(basename ${i}.png)\", Action (Mouse 1) ChangeWallpaper \"${i}\")"
+done
+
+[ "$DEBUG" == "1" ] && echo "# x,y = $x,$y"
+
+exit 0
diff --git a/scripts/random_wallpaper.sh b/scripts/random_wallpaper.sh
new file mode 100755
index 0000000..213e6fc
--- /dev/null
+++ b/scripts/random_wallpaper.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# Reads a given directory and set a random
+# wallpaper using the images on that dir.
+
+if [[ -d "${WALLPAPERDIR}" ]]
+then
+ files=$(ls "${WALLPAPERDIR}")
+ file_matrix=($files)
+ num_files=${#file_matrix[*]}
+ convert "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}" -resize `xdpyinfo |grep dimensions|awk '{print $2}'` "${FVWM_USERDIR}/tmp/current_wall.png"
+ feh --bg-center "${FVWM_USERDIR}/tmp/current_wall.png"
+fi
+
+exit 0
diff --git a/scripts/traffic.sh b/scripts/traffic.sh
new file mode 100755
index 0000000..67910da
--- /dev/null
+++ b/scripts/traffic.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+while true
+do
+ clear
+ vnstat -u; vnstat -i ppp0 | grep Database | awk '{print "updated : " $6}'
+ vnstat -u; vnstat -i ppp0 | grep received | awk '{print "download : " $2 $3}'
+ vnstat -u; vnstat -i ppp0 | grep transmitted | awk '{print "upload : " $2 $3}'
+ vnstat -u; vnstat -i ppp0 | grep total: | awk '{print "total : " $2 $3}'
+ sleep 60
+done