{"id":127,"date":"2011-01-08T19:07:00","date_gmt":"2011-01-08T19:07:00","guid":{"rendered":"http:\/\/aldarias.es\/wordpress\/?p=127"},"modified":"2011-01-08T19:07:00","modified_gmt":"2011-01-08T19:07:00","slug":"rotar-fondos-con-gnome-y-bash","status":"publish","type":"post","link":"http:\/\/aldarias.es\/wordpress\/?p=127","title":{"rendered":"ROTAR FONDOS CON GNOME Y BASH"},"content":{"rendered":"<p># fondorotar.sh<br \/># Por Paco Aldarias<br \/># 8.1.11<br \/># Esta funci\u00f3n rota los fondos del escritorio gnome<\/p>\n<p>usuario=\u00bb\/home\/paco\u00bb<br \/>dirfondos=\u00bb\/media\/sda5\/fotos\u00bb<\/p>\n<p>lanzador=\u00bb$usuario\/Escritorio\/Fondo.desktop\u00bb<br \/>icono=\u00bbpitivi\u00bb<\/p>\n<p>fimagenes=\u00bb\/tmp\/fimagenes.txt\u00bb<br \/>ftot=\u00bb\/tmp\/ftot.txt\u00bb<\/p>\n<p>#***********************<br \/>function lanzador<br \/>{<br \/>echo \u00ab#!\/usr\/bin\/env xdg-open\u00bb > $lanzador<br \/>echo \u00ab[Desktop Entry]\u00bb>> $lanzador<br \/>echo \u00abVersion=1.0&#8243;>> $lanzador<br \/>echo \u00abType=Application\u00bb>> $lanzador<br \/>echo \u00abTerminal=false\u00bb>> $lanzador<br \/>echo \u00abIcon[es_ES]=pitivi\u00bb>> $lanzador<br \/>echo \u00abExec=bash \/home\/paco\/fondorotar.sh\u00bb>> $lanzador<br \/>echo \u00abName[es_ES]=Fondo $1&#8243;>> $lanzador<br \/>echo \u00abIcon=gparted\u00bb>> $lanzador<br \/>echo \u00abName=Fondo $1&#8243;>> $lanzador<br \/>}<\/p>\n<p>#***********************<br \/>function cambia<br \/>{<br \/>gconftool-2 -t str -s \/desktop\/gnome\/background\/picture_filename $1<br \/>#Possible values are \u00abnone\u00bb, \u00abwallpaper\u00bb (eg tiled), \u00abcentered\u00bb, \u00abscaled\u00bb, \u00abstretched\u00bb<br \/>gconftool-2 -t string -s \/desktop\/gnome\/background\/picture_options \u00abstretched\u00bb<br \/>}<\/p>\n<p>#***********************<br \/>function numero<br \/>{<br \/>num=$1<br \/>tema=$(cat $fimagenes | sed -n ${num}L)<br \/>cambia \u00ab$tema\u00bb<br \/>lanzador \u00ab$tema\u00bb<br \/>}<\/p>\n<p>#***************** MAIN<\/p>\n<p># Si no existe lo crea<br \/>if [ ! -f $fimagenes ]; then <br \/>   find $dirfondos -iname &#8216;*.jpg&#8217; -o -iname &#8216;*.png&#8217; -o -iname &#8216;*.svg&#8217; > $fimagenes<br \/>   cat  $fimagenes | wc -l  > $ftot<br \/>fi<\/p>\n<p># Total de fondos.<br \/>tot=$(cat $ftot)<\/p>\n<p># Numero aleatorio<br \/>num=$(($RANDOM%$tot))<br \/>numero $num<\/p>\n","protected":false},"excerpt":{"rendered":"<p># fondorotar.sh# Por Paco Aldarias# 8.1.11# Esta funci\u00f3n rota los fondos del escritorio gnome usuario=\u00bb\/home\/paco\u00bbdirfondos=\u00bb\/media\/sda5\/fotos\u00bb lanzador=\u00bb$usuario\/Escritorio\/Fondo.desktop\u00bbicono=\u00bbpitivi\u00bb fimagenes=\u00bb\/tmp\/fimagenes.txt\u00bbftot=\u00bb\/tmp\/ftot.txt\u00bb #***********************function lanzador{echo \u00ab#!\/usr\/bin\/env xdg-open\u00bb > $lanzadorecho \u00ab[Desktop Entry]\u00bb>> $lanzadorecho \u00abVersion=1.0&#8243;>> $lanzadorecho \u00abType=Application\u00bb>> $lanzadorecho \u00abTerminal=false\u00bb>> $lanzadorecho \u00abIcon[es_ES]=pitivi\u00bb>> $lanzadorecho \u00abExec=bash \/home\/paco\/fondorotar.sh\u00bb>> $lanzadorecho \u00abName[es_ES]=Fondo $1&#8243;>> $lanzadorecho &hellip; <a href=\"http:\/\/aldarias.es\/wordpress\/?p=127\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","itunes_episode_number":"","itunes_title":"","itunes_season_number":"","itunes_episode_type":"","footnotes":""},"categories":[13,123,182,117],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-bash","category-fondos","category-gnome","category-script"],"_links":{"self":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":0,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}