From adc8b6093fac46987a47ab11e1cee73e1ab3477b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20H=2E=20Gombos?= Date: Sun, 31 Aug 2014 20:42:30 +0200 Subject: [PATCH] add already written scripts --- bin/.ny-vis.swp | Bin 0 -> 12288 bytes bin/bergentrainz | 8 ++ bin/cookie | 7 ++ bin/maya | 3 + bin/narwhals | 4 + bin/nordlandstrainz | 8 ++ bin/ny-vis | 25 +++++ bin/quiet | 5 + bin/saxguy | 3 + bin/troll | 4 + bin/vis | 25 +++++ bin/vladislav | 3 + bin/weather | 5 + bin/why-brzeczyszczykiewicz | 3 + bin/xkcd | 21 ++++ screensavers/cookie.html | 158 ++++++++++++++++++++++++++++ screensavers/cookie/Main.elm | 63 +++++++++++ screensavers/cookie/build/Main.html | 158 ++++++++++++++++++++++++++++ screensavers/cookie/cache/Main.elmi | Bin 0 -> 5781 bytes screensavers/cookie/cache/Main.elmo | 157 +++++++++++++++++++++++++++ 20 files changed, 660 insertions(+) create mode 100644 bin/.ny-vis.swp create mode 100755 bin/bergentrainz create mode 100755 bin/cookie create mode 100755 bin/maya create mode 100755 bin/narwhals create mode 100755 bin/nordlandstrainz create mode 100755 bin/ny-vis create mode 100755 bin/quiet create mode 100755 bin/saxguy create mode 100755 bin/troll create mode 100755 bin/vis create mode 100755 bin/vladislav create mode 100755 bin/weather create mode 100755 bin/why-brzeczyszczykiewicz create mode 100755 bin/xkcd create mode 100644 screensavers/cookie.html create mode 100644 screensavers/cookie/Main.elm create mode 100644 screensavers/cookie/build/Main.html create mode 100644 screensavers/cookie/cache/Main.elmi create mode 100644 screensavers/cookie/cache/Main.elmo diff --git a/bin/.ny-vis.swp b/bin/.ny-vis.swp new file mode 100644 index 0000000000000000000000000000000000000000..2f3769be077108e966d8b0971e0d388b7671d8a9 GIT binary patch literal 12288 zcmeI2&uSA<6o*gUMX0T<4{$mO7==lbs8}cg7b3b47g9GN$o#pJxy@weIx|U|h}MM* zK_A1FPf*uBK_9^v(2ef>%{XW(6;}lV=fammZq7OPW>0l?W{zx%0Wok61}1r6 z@2u|K=yuvg_qw&kn;U!QaFDbV17bi7hygJm2E>3E5CdZ1e>ISs6*|Ij7peidiYtG_ z>Z=4XAO^&M7!U(uKn#chF(3xSfEW-1VqggkI6hIfO0;$f!{hxwSO4ML8qsI)5gdbe z;4RSL5!eA8V1p*O3NC{0=<@}ffDhn3cmrO8SKtT?!9CChSHLFN0GGi!C}&whmol;# z5CdXB42S_SAO^&M7!U(uVA%{XR-Gef$WEl4j5Uuw9giJjR7`cw_SI;_$(VhWvr3EK z=x0TiJ890dWRg!@9JOv#PdHZV%aN zbgXMsQ&Fa>4BL*9#PoC={4H4r-0yRv%e@|3MY6?%!7k?^rY{!LA3*U9JkbVF>_PvY% literal 0 HcmV?d00001 diff --git a/bin/bergentrainz b/bin/bergentrainz new file mode 100755 index 0000000..73dccb6 --- /dev/null +++ b/bin/bergentrainz @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import random +import os + +time=int(random.random()*100) +timestr=str(time)+"%" +os.system("mpv ~/youtube-dl-vids/bergensbanen.mp4 --start=%s" %timestr) diff --git a/bin/cookie b/bin/cookie new file mode 100755 index 0000000..63d4b70 --- /dev/null +++ b/bin/cookie @@ -0,0 +1,7 @@ +#!/bin/bash + +pidof elm-server || (cd "$HOME/.local/lib" elm-server) & + +sleep 1 + +chromium-browser --app="http://localhost:8000/cookie.elm" diff --git a/bin/maya b/bin/maya new file mode 100755 index 0000000..a7a7b13 --- /dev/null +++ b/bin/maya @@ -0,0 +1,3 @@ +#!/bin/bash +xset dpms force on +mpv --loop=inf ~/youtube-dl-vids/maya.mp4 diff --git a/bin/narwhals b/bin/narwhals new file mode 100755 index 0000000..9ebb3c7 --- /dev/null +++ b/bin/narwhals @@ -0,0 +1,4 @@ +#!/bin/bash +xset dpms force on +wait 3 +mpv ~/youtube-dl-vids/narwhals.mp4 diff --git a/bin/nordlandstrainz b/bin/nordlandstrainz new file mode 100755 index 0000000..d3017ab --- /dev/null +++ b/bin/nordlandstrainz @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import random +import os + +time=int(random.random()*100) +timestr=str(time)+"%" +os.system("mpv ~/youtube-dl-vids/nordlandsbanen.mp4 --start=%s" %timestr) diff --git a/bin/ny-vis b/bin/ny-vis new file mode 100755 index 0000000..9897bbb --- /dev/null +++ b/bin/ny-vis @@ -0,0 +1,25 @@ +#!/bin/bash +xset dpms force on +echo "Hold your breath and wait 15sec." + +picture_type=(".jpg" ".jpeg" ".png" ".bmp") + +for i in "${picture_type[@]}"; do + if [[ $1 == *$i ]]; then + mpv --keep-open "$1" + exit + fi + done + +if [[ $1 == *".gif" ]]; then + mpv --loop=inf "$1" +else + if [[ $2 == "loop" ]]; then + mpv --loop=inf $(youtube-dl -g "$1") + else + mpv $(youtube-dl -g "$1") + fi +fi + + + diff --git a/bin/quiet b/bin/quiet new file mode 100755 index 0000000..b09a7e5 --- /dev/null +++ b/bin/quiet @@ -0,0 +1,5 @@ +#!/bin/bash +killall chromium-browser +killall mpv +killall python +killall feh diff --git a/bin/saxguy b/bin/saxguy new file mode 100755 index 0000000..248915a --- /dev/null +++ b/bin/saxguy @@ -0,0 +1,3 @@ +#!/bin/bash +xset dpms force on +mpv --loop=inf ~/youtube-dl-vids/epicsaxguy.mp4 diff --git a/bin/troll b/bin/troll new file mode 100755 index 0000000..64c92e5 --- /dev/null +++ b/bin/troll @@ -0,0 +1,4 @@ +#!/bin/bash +xset dpms force on +wait 3 +mpv ~/youtube-dl-vids/troll.mp4 diff --git a/bin/vis b/bin/vis new file mode 100755 index 0000000..9897bbb --- /dev/null +++ b/bin/vis @@ -0,0 +1,25 @@ +#!/bin/bash +xset dpms force on +echo "Hold your breath and wait 15sec." + +picture_type=(".jpg" ".jpeg" ".png" ".bmp") + +for i in "${picture_type[@]}"; do + if [[ $1 == *$i ]]; then + mpv --keep-open "$1" + exit + fi + done + +if [[ $1 == *".gif" ]]; then + mpv --loop=inf "$1" +else + if [[ $2 == "loop" ]]; then + mpv --loop=inf $(youtube-dl -g "$1") + else + mpv $(youtube-dl -g "$1") + fi +fi + + + diff --git a/bin/vladislav b/bin/vladislav new file mode 100755 index 0000000..d8784c3 --- /dev/null +++ b/bin/vladislav @@ -0,0 +1,3 @@ +#!/bin/bash +xset dpms force on +mpv ~/youtube-dl-vids/vladislav.mp4 diff --git a/bin/weather b/bin/weather new file mode 100755 index 0000000..38d6851 --- /dev/null +++ b/bin/weather @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os + +os.system("feh --auto-zoom --fullscreen --slideshow-delay 20 --cycle-once http://www.yr.no/place/Norway/S%C3%B8r-Tr%C3%B8ndelag/Trondheim/Trondheim/meteogram.png") diff --git a/bin/why-brzeczyszczykiewicz b/bin/why-brzeczyszczykiewicz new file mode 100755 index 0000000..0bc2c0b --- /dev/null +++ b/bin/why-brzeczyszczykiewicz @@ -0,0 +1,3 @@ +#!/bin/bash +xset dpms force on +mpv ~/youtube-dl-vids/brzeczyszczykiewicz.mp4 diff --git a/bin/xkcd b/bin/xkcd new file mode 100755 index 0000000..b6a06d5 --- /dev/null +++ b/bin/xkcd @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import json +import urllib2 +import os +import random + +os.system("xset dpms force on") + +newest = "http://xkcd.com/info.0.json" + +response = urllib2.urlopen(newest) + +obj = json.load(response) + +highest = obj['num'] +for i in range(500): + newcomic = "http://xkcd.com/%s/info.0.json"%str(int(random.random()*highest+1)) + response = urllib2.urlopen(newcomic) + newobj = json.load(response) + os.system("feh %s --fullscreen --zoom max --slideshow-delay 20 --cycle-once" %newobj['img']) diff --git a/screensavers/cookie.html b/screensavers/cookie.html new file mode 100644 index 0000000..d1b9b40 --- /dev/null +++ b/screensavers/cookie.html @@ -0,0 +1,158 @@ + +cookie \ No newline at end of file diff --git a/screensavers/cookie/Main.elm b/screensavers/cookie/Main.elm new file mode 100644 index 0000000..d2d234e --- /dev/null +++ b/screensavers/cookie/Main.elm @@ -0,0 +1,63 @@ +import Window + +main = paint <~ Window.dimensions ~ 30 `timesPer`second + +paint (w,h) time + = layers + [ bgBlue + |> size w h + , foreground time + |> fit (floor <| toFloat w*0.7) (floor <| toFloat h*0.7) + |> container w h middle + ,sound + ] + +foreground time + = collage 512 512 + [ shine + |> alpha 0.5 + |> rotate (time* -30 `degreesPer`second) + , shine + |> alpha 0.25 + |> rotate (time* 15 `degreesPer`second) + , nest + |> moveY -130 + , cookie + ] + + +bgBlue = tiledImg "bgBlue.jpg" +cookie = img 256 256 "perfectCookie.png" +shine = img 512 512 "shine.png" +nest = img 304 161 "nest.png" + + +baseUrl = "http://orteil.dashnet.org/cookieclicker/img/" +img x y = toForm . image x y . (++) baseUrl +tiledImg = tiledImage 0 0 . (++) baseUrl + +fit w h elem = + let + (ew,eh) = sizeOf elem + aspWin = w // h + aspPic = ew // eh + fac = if aspPic > aspWin + then w // ew + else h // eh + in + elem + |> toForm + |> scale fac + |> collage w h . flip(::)[] + +timesPer count interval = every <| interval/count +degreesPer angle time = degrees angle / time + +(//) a b = toFloat a / toFloat b + + +sound = [markdown| + +|] diff --git a/screensavers/cookie/build/Main.html b/screensavers/cookie/build/Main.html new file mode 100644 index 0000000..da01ced --- /dev/null +++ b/screensavers/cookie/build/Main.html @@ -0,0 +1,158 @@ + +Main \ No newline at end of file diff --git a/screensavers/cookie/cache/Main.elmi b/screensavers/cookie/cache/Main.elmi new file mode 100644 index 0000000000000000000000000000000000000000..e4400ea856fbe07b4c78dc22a24fb63bbe304100 GIT binary patch literal 5781 zcmeHL&2HN;3|105S=SWZdFV5^!yci-I&|2I0L`#tq1uWqM79h|>CfBGkw`UGlw5W) z;v6E2`bfznMbae1{G#8KSN4%iV8mg5fPM+|*_JoCz9wS?-c=fzgG2IHI+g(2x<@b_QVqN55SRI`?f_U=HC-CEf~)Wcl61w zJ}opZI95_ok%w$bduHO(6wAVz_90B1?;uoIj0x^Mo2(gw- zrCf7o$th?hrlKw=vIox)tz=Uo;HmfTRq)7uu}={Z&@6%6@;l4D&keSGuL z>rn}#I z?vp+xaI|sxAAO8)VTb_d9K)Sbd?1UxuKs*o>0iX#g%LOAvQMc!#(Jdm#%f?pr)JXLqEBO7_>eQ q1E6E(1LpTs^JkVUWTW@q 

 
", + "59:9"); + _op["//"] = F2(function (a,b) { + return Basics.toFloat(a) / Basics.toFloat(b); + }); + var degreesPer = F2(function (angle, + time) { + return Basics.degrees(angle) / time; + }); + var timesPer = F2(function (count, + interval) { + return Time.every(interval / count); + }); + var fit = F3(function (w, + h, + elem) { + return function () { + var aspWin = A2(_op["//"], + w, + h); + var $ = Graphics.Element.sizeOf(elem), + ew = $._0, + eh = $._1; + var aspPic = A2(_op["//"], + ew, + eh); + var fac = _U.cmp(aspPic, + aspWin) > 0 ? A2(_op["//"], + w, + ew) : A2(_op["//"],h,eh); + return function ($) { + return A2(Graphics.Collage.collage, + w, + h)(A2(Basics.flip, + F2(function (x,y) { + return {ctor: "::" + ,_0: x + ,_1: y}; + }), + _L.fromArray([]))($)); + }(Graphics.Collage.scale(fac)(Graphics.Collage.toForm(elem))); + }(); + }); + var baseUrl = "http://orteil.dashnet.org/cookieclicker/img/"; + var img = F2(function (x,y) { + return function ($) { + return Graphics.Collage.toForm(A2(Graphics.Element.image, + x, + y)(F2(function (x,y) { + return _L.append(x,y); + })(baseUrl)($))); + }; + }); + var tiledImg = function ($) { + return A2(Graphics.Element.tiledImage, + 0, + 0)(F2(function (x,y) { + return _L.append(x,y); + })(baseUrl)($)); + }; + var nest = A3(img, + 304, + 161, + "nest.png"); + var shine = A3(img, + 512, + 512, + "shine.png"); + var cookie = A3(img, + 256, + 256, + "perfectCookie.png"); + var bgBlue = tiledImg("bgBlue.jpg"); + var foreground = function (time) { + return A3(Graphics.Collage.collage, + 512, + 512, + _L.fromArray([Graphics.Collage.rotate(time * A2(degreesPer, + -30, + Time.second))(Graphics.Collage.alpha(0.5)(shine)) + ,Graphics.Collage.rotate(time * A2(degreesPer, + 15, + Time.second))(Graphics.Collage.alpha(0.25)(shine)) + ,Graphics.Collage.moveY(-130)(nest) + ,cookie])); + }; + var paint = F2(function (_v0, + time) { + return function () { + switch (_v0.ctor) + {case "_Tuple2": + return Graphics.Element.layers(_L.fromArray([A2(Graphics.Element.size, + _v0._0, + _v0._1)(bgBlue) + ,A3(Graphics.Element.container, + _v0._0, + _v0._1, + Graphics.Element.middle)(A2(fit, + Basics.floor(Basics.toFloat(_v0._0) * 0.7), + Basics.floor(Basics.toFloat(_v0._1) * 0.7))(foreground(time))) + ,sound]));} + _E.Case($moduleName, + "between lines 6 and 13"); + }(); + }); + var main = A2(Signal._op["~"], + A2(Signal._op["<~"], + paint, + Window.dimensions), + A2(timesPer,30,Time.second)); + _elm.Main.values = {_op: _op + ,main: main + ,paint: paint + ,foreground: foreground + ,bgBlue: bgBlue + ,cookie: cookie + ,shine: shine + ,nest: nest + ,baseUrl: baseUrl + ,img: img + ,tiledImg: tiledImg + ,fit: fit + ,timesPer: timesPer + ,degreesPer: degreesPer + ,sound: sound}; + return _elm.Main.values; +}; \ No newline at end of file