commit adc8b6093fac46987a47ab11e1cee73e1ab3477b Author: Péter H. Gombos Date: Sun Aug 31 20:42:30 2014 +0200 add already written scripts diff --git a/bin/.ny-vis.swp b/bin/.ny-vis.swp new file mode 100644 index 0000000..2f3769b Binary files /dev/null and b/bin/.ny-vis.swp differ 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 0000000..e4400ea Binary files /dev/null and b/screensavers/cookie/cache/Main.elmi differ diff --git a/screensavers/cookie/cache/Main.elmo b/screensavers/cookie/cache/Main.elmo new file mode 100644 index 0000000..b40c9e8 --- /dev/null +++ b/screensavers/cookie/cache/Main.elmo @@ -0,0 +1,157 @@ +Elm.Main = Elm.Main || {}; +Elm.Main.make = function (_elm) { + "use strict"; + _elm.Main = _elm.Main || {}; + if (_elm.Main.values) + return _elm.Main.values; + var _N = Elm.Native, + _U = _N.Utils.make(_elm), + _L = _N.List.make(_elm), + _A = _N.Array.make(_elm), + _E = _N.Error.make(_elm), + $moduleName = "Main"; + var Basics = Elm.Basics.make(_elm); + var Color = Elm.Color.make(_elm); + var Graphics = Graphics || {}; + Graphics.Collage = Elm.Graphics.Collage.make(_elm); + var Graphics = Graphics || {}; + Graphics.Element = Elm.Graphics.Element.make(_elm); + var List = Elm.List.make(_elm); + var Maybe = Elm.Maybe.make(_elm); + var Native = Native || {}; + Native.Json = Elm.Native.Json.make(_elm); + var Native = Native || {}; + Native.Ports = Elm.Native.Ports.make(_elm); + var Signal = Elm.Signal.make(_elm); + var String = Elm.String.make(_elm); + var Text = Elm.Text.make(_elm); + var Time = Elm.Time.make(_elm); + var Window = Elm.Window.make(_elm); + var _op = {}; + var sound = Text.markdown("
 

 
", + "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