aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-05-17 14:41:53 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-05-17 14:41:53 +0200
commit4e7cf6c285f1e932a04e16cf144917333b78e579 (patch)
treed65cf35abcccc73c25e2e16953b888dc8b99a266
parent1ce6627eb3c82b110eb24a28fa7697e271c21ffa (diff)
downloadscripts-4e7cf6c285f1e932a04e16cf144917333b78e579.tar.gz
scripts-4e7cf6c285f1e932a04e16cf144917333b78e579.zip
i3blocks: short mem text and fixed exit when cmus not running.
-rwxr-xr-xi3blocks/i3mem.sh1
-rwxr-xr-xi3blocks/i3music.sh2
-rw-r--r--mapGen/bigmap.dg55
-rw-r--r--mapGen/chamber.xcfbin0 -> 777 bytes
-rw-r--r--mapGen/door.xcfbin0 -> 804 bytes
-rw-r--r--mapGen/floor.xcfbin0 -> 723 bytes
-rw-r--r--mapGen/grass.xcfbin0 -> 801 bytes
-rw-r--r--mapGen/greenBlueRedOut.jpgbin0 -> 16272 bytes
-rw-r--r--mapGen/map.dg5
-rwxr-xr-xmapGen/mapGen.sh38
-rw-r--r--mapGen/mapOut.jpgbin0 -> 263440 bytes
-rw-r--r--mapGen/out.jpgbin0 -> 15478 bytes
-rw-r--r--mapGen/passage.xcfbin0 -> 795 bytes
-rw-r--r--mapGen/randomMap.dg26
-rw-r--r--mapGen/secretDoor.xcfbin0 -> 801 bytes
-rw-r--r--mapGen/tiles/Cchamber.jpgbin0 -> 1278 bytes
-rw-r--r--mapGen/tiles/Ddoor.jpgbin0 -> 1282 bytes
-rw-r--r--mapGen/tiles/Ggrass.jpgbin0 -> 1275 bytes
-rw-r--r--mapGen/tiles/Ppassage.jpgbin0 -> 1286 bytes
-rw-r--r--mapGen/tiles/SsecretDoor.jpgbin0 -> 1280 bytes
-rw-r--r--mapGen/tiles/Xwall.jpgbin0 -> 1267 bytes
-rw-r--r--mapGen/tiles/ofloor.jpgbin0 -> 1263 bytes
-rw-r--r--mapGen/wall.xcfbin0 -> 768 bytes
23 files changed, 126 insertions, 1 deletions
diff --git a/i3blocks/i3mem.sh b/i3blocks/i3mem.sh
index 3e1447e..fc7b94d 100755
--- a/i3blocks/i3mem.sh
+++ b/i3blocks/i3mem.sh
@@ -6,3 +6,4 @@ $(ps axch -o cmd:18,%mem --sort=-%mem | sed 10q)" ;;
esac
free -h | awk '/^Mem/ {print $3 "/" $2}'
+free -h | awk '/^Mem/ {print $3}'
diff --git a/i3blocks/i3music.sh b/i3blocks/i3music.sh
index bb646b9..d446b50 100755
--- a/i3blocks/i3music.sh
+++ b/i3blocks/i3music.sh
@@ -8,7 +8,7 @@ esac
symbol=🎵
ampersand='and' # & in echo messes up script
-pgrep -x cmus >/dev/null || (echo "" && exit 0)
+pgrep -x cmus >/dev/null || exit 0
stat="$(cmus-remote -Q | grep "^status " | awk '{print $2}' | sed "s/&/$ampersand/")"
artist="$(cmus-remote -Q | grep "^tag artist " | cut -d' ' -f3- | sed "s/&/$ampersand/")"
title="$(cmus-remote -Q | grep "^tag title " | cut -d' ' -f3- | sed "s/&/$ampersand/")"
diff --git a/mapGen/bigmap.dg b/mapGen/bigmap.dg
new file mode 100644
index 0000000..26f5289
--- /dev/null
+++ b/mapGen/bigmap.dg
@@ -0,0 +1,55 @@
+xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-
+xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx
+xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG
+-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx
+-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-x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x-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
+xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-
+xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx
+xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG
+-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx
+-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
+xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-
+xGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxxxGGxx
+xxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGGxxGGG
+-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx-xGGx
+-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
diff --git a/mapGen/chamber.xcf b/mapGen/chamber.xcf
new file mode 100644
index 0000000..2198b9b
--- /dev/null
+++ b/mapGen/chamber.xcf
Binary files differ
diff --git a/mapGen/door.xcf b/mapGen/door.xcf
new file mode 100644
index 0000000..fa1cc1a
--- /dev/null
+++ b/mapGen/door.xcf
Binary files differ
diff --git a/mapGen/floor.xcf b/mapGen/floor.xcf
new file mode 100644
index 0000000..a83e4c2
--- /dev/null
+++ b/mapGen/floor.xcf
Binary files differ
diff --git a/mapGen/grass.xcf b/mapGen/grass.xcf
new file mode 100644
index 0000000..3b11c90
--- /dev/null
+++ b/mapGen/grass.xcf
Binary files differ
diff --git a/mapGen/greenBlueRedOut.jpg b/mapGen/greenBlueRedOut.jpg
new file mode 100644
index 0000000..7448cc8
--- /dev/null
+++ b/mapGen/greenBlueRedOut.jpg
Binary files differ
diff --git a/mapGen/map.dg b/mapGen/map.dg
new file mode 100644
index 0000000..7da4706
--- /dev/null
+++ b/mapGen/map.dg
@@ -0,0 +1,5 @@
+xxxxx
+xGGxx
+xxaaG
+xxGax
+xxxxx
diff --git a/mapGen/mapGen.sh b/mapGen/mapGen.sh
new file mode 100755
index 0000000..1be77f7
--- /dev/null
+++ b/mapGen/mapGen.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# mapGen.sh
+#
+# Generate a map with ImageMagick from an input text file
+
+inputFile="$1"
+
+cellSize=8
+
+tilesDir="./tiles"
+
+height="$(wc -l <"$inputFile")"
+width="$(awk '{print length($0)}' "$inputFile" | sort -nr | sed 1q)"
+
+height=$((height*cellSize))
+width=$((width*cellSize))
+
+echo $width $height
+
+convert -size "$width"x"$height" xc:cyan out.jpg
+
+row=0
+col=0
+
+while read line; do
+ echo "$line" | (
+ while read -n1 char; do
+ tileFile="$(find $tilesDir | sed 's|.*/||' | grep "^$char")"
+ tileFile="${tilesDir}/${tileFile}"
+ echo "$tileFile" | wc -l | grep 1 >/dev/null || continue
+ convert out.jpg "$tileFile" -geometry +"$col"+"$row" -composite out.jpg ||
+ convert out.jpg -fill red -draw "point $col,$row" out.jpg
+ col=$((col+cellSize))
+ done)
+ row=$((row+cellSize))
+ col=0
+done <"$inputFile"
diff --git a/mapGen/mapOut.jpg b/mapGen/mapOut.jpg
new file mode 100644
index 0000000..7067c52
--- /dev/null
+++ b/mapGen/mapOut.jpg
Binary files differ
diff --git a/mapGen/out.jpg b/mapGen/out.jpg
new file mode 100644
index 0000000..d4a3964
--- /dev/null
+++ b/mapGen/out.jpg
Binary files differ
diff --git a/mapGen/passage.xcf b/mapGen/passage.xcf
new file mode 100644
index 0000000..926783a
--- /dev/null
+++ b/mapGen/passage.xcf
Binary files differ
diff --git a/mapGen/randomMap.dg b/mapGen/randomMap.dg
new file mode 100644
index 0000000..2ead560
--- /dev/null
+++ b/mapGen/randomMap.dg
@@ -0,0 +1,26 @@
+XXXXXXXXXXXXXXXXXXXX
+XXXXXXooooooooXXXXXX
+XXXXXXoooooooooXXXXX
+XXXXXXooooooooooooXX
+XXXXCDooooooooooooDX
+XXXXXXooooooooooooXX
+XXXXXXooooooooooooXX
+XXXXXXoooooooooXXXXX
+XXXXXXooooooooXXXXXX
+XXXXXXXXXSXXXXXXXXXX
+XXXXXXXXooooXXXXXXXX
+XXXXXXXooooooXXXXXXX
+XXXXXXooooooooXXXXXX
+XooooXoooCooooXooooX
+XoCooXooooooooXooooX
+XooooXooooooooXooooX
+XooooXXooooooXXooooX
+XooooXXXooooXXXooooX
+XooooXXXXooXXXXooooX
+XXXoXXXXXooXXXXXooXX
+XXXoXXXXooooXXXXooXX
+XXXoooooooooooooooXX
+XXXXXXooooooooooooXX
+XXXXXXXXooooXXXXXXXX
+XXXXXXXXXooXXXXXXXXX
+XXXXXXXXXooXXXXXXXXX
diff --git a/mapGen/secretDoor.xcf b/mapGen/secretDoor.xcf
new file mode 100644
index 0000000..6963426
--- /dev/null
+++ b/mapGen/secretDoor.xcf
Binary files differ
diff --git a/mapGen/tiles/Cchamber.jpg b/mapGen/tiles/Cchamber.jpg
new file mode 100644
index 0000000..a325761
--- /dev/null
+++ b/mapGen/tiles/Cchamber.jpg
Binary files differ
diff --git a/mapGen/tiles/Ddoor.jpg b/mapGen/tiles/Ddoor.jpg
new file mode 100644
index 0000000..167a16d
--- /dev/null
+++ b/mapGen/tiles/Ddoor.jpg
Binary files differ
diff --git a/mapGen/tiles/Ggrass.jpg b/mapGen/tiles/Ggrass.jpg
new file mode 100644
index 0000000..a3f79e6
--- /dev/null
+++ b/mapGen/tiles/Ggrass.jpg
Binary files differ
diff --git a/mapGen/tiles/Ppassage.jpg b/mapGen/tiles/Ppassage.jpg
new file mode 100644
index 0000000..d21a0e9
--- /dev/null
+++ b/mapGen/tiles/Ppassage.jpg
Binary files differ
diff --git a/mapGen/tiles/SsecretDoor.jpg b/mapGen/tiles/SsecretDoor.jpg
new file mode 100644
index 0000000..ee974fa
--- /dev/null
+++ b/mapGen/tiles/SsecretDoor.jpg
Binary files differ
diff --git a/mapGen/tiles/Xwall.jpg b/mapGen/tiles/Xwall.jpg
new file mode 100644
index 0000000..7d70085
--- /dev/null
+++ b/mapGen/tiles/Xwall.jpg
Binary files differ
diff --git a/mapGen/tiles/ofloor.jpg b/mapGen/tiles/ofloor.jpg
new file mode 100644
index 0000000..d79d794
--- /dev/null
+++ b/mapGen/tiles/ofloor.jpg
Binary files differ
diff --git a/mapGen/wall.xcf b/mapGen/wall.xcf
new file mode 100644
index 0000000..e1cc359
--- /dev/null
+++ b/mapGen/wall.xcf
Binary files differ