Shintsha ngokuzenzakalela iphephadonga ngeNitrogen

Bangaki kini abasebenzisa "umphathi wewindi weTiling" futhi ngokuqinisekile ngemuva kwesikhashana iphepha lodonga lethu liyasibhora? Kuyacasula kakhulu ukuthi kufanele uhlanganise kabusha ukuze ukwazi ukushintsha iphephadonga elilula, noma uphinde usebenzise i- "nitrogen" bese udlulisa enye ipharamitha kuyo.

Yebo, namhlanje ngikulethela umbhalo we-bash, uthola isithombe esingahleliwe kusuka eqoqweni lethu bese usibeka njengephepha lodonga Shintsha i-Nitrogen Wallpaper, uma ulanda iskripthi kusuka ku- lapha ungakhohlwa ukususa isandiso se-.txt efayeleni bese usinika ukuthi sisebenzise izimvume

umkhombandlela = ~ / Izithombe zisebenza my_resolution () {res = `xrandr | grep '*' | grep -o -E '[0-9] + x [0-9] +' `my_high =` echo "$ res" | cut -d "x" -f 2` my_width = `echo" $ res "| cut -d "x" -f 1`} function rand_image () {image = `ls -1 -b -R" $ directory "| grep -i -e ".png" -e ".jpg" -e ".jpeg" | hlunga - uhlobo oluhleliwe | head -1` image_dir = `find" $ directory "-iname" $ ​​image ""} function image_resolution () {rand_image high_image = `identit -format"% h "" $ image_dir "` wide_image = `ident--format"% w "" $ image_dir "`} function ratio () {my_resolution image_resolution height_rate = `echo $ image_high / $ my_high | bc -l` proportion_width =` echo $ image_width / $ my_width | bc -l`} function scalar () {isilinganiso uma [`echo" $ ratio_high> 1 "| bc` -eq 1 -o` echo" $ ratio_width> 1 "| bc` -eq 1]; bese i-nitrogen --set-zoom "$ image_dir" enye i-nitrogen - isethi egxile "$ image_dir" fi} isikali sokuphuma

Manje kuza incazelo yombhalo.
umkhombandlela = ~ / Izithombe // Shintshela enkombeni lapho kutholakala khona amaphephadonga wakho

ukulungiswa kwesithombe () // Lo msebenzi uthola ukutholwa kwesixazululo sethu, bese usigcina kokuguqukayo:
my_high // Phezulu
my_width // Ububanzi

rand_image () // Lo msebenzi uthola isithombe ngaphakathi «lwemibhalo»

isithombe = `ls -1 -b -R" $ directory "| grep -i -e ".png" -e ".jpg" -e ".jpeg" | hlunga -okungahleliwe-hlunga | ikhanda -1`

OKUBALULEKILE! Uma ubona sihlunga wonke amafayela nge- "extension" .png, .jpg, .jpeg. Faka -e ".extension" njengoba kufanele.

Isibonelo:

imagen=`ls -1 -b -R "$directorio" | grep -i -e ".png" -e ".jpg" -e ".jpeg" -e ".nueva_extensión" | sort --random-sort | head -1`

ukulungiswa kwesithombe () // Lo msebenzi uthola ukulungiswa kwesithombe esitholwe umsebenzi we-rand_image ()

isilinganiso () // Lo msebenzi uthola isilinganiso image_resolution / screen_resolution

khwela () // Lo msebenzi ulinganisa isithombe uma sikhulu kunokuxazululwa kwesiqaphi sethu futhi usetha isithombe sangemuva

Manje njengoba sesinombhalo wokunikeza iphephadonga elingahleliwe ku-nitrogen (futhi nesithombe sijwayela ukuqapha kwakho) kufanele senze iskripthi sisebenze njalo kaningi, lokhu kutholakala ngokwenza umyalo olandelayo ekuqaleni

watch -n 4 ruta_donde_se_encuentra_el_script/nombre_del_script

Kulokhu, lo myalo wenziwa njalo ngemizuzwana emi-4, qaphela ukuthi path_where_the_script_is_found yindlela ephelele lapho kutholakala khona iskripthi futhi igama elithi script_name igama elinikezwe iskripthi.

Ngiyethemba uyithola ilusizo.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-9, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   KZKG ^ Gaara kusho

    Ngizohlola le Nitrogen ukuthola umbhalo we-KDE engifuna ukuwenza :)
    Ngaphandle kwalokho okuthunyelwe okuhle ... hahahaha, isithombe esihle osikhethele okuthunyelwe (Snoopy LOL !!!)

    1.    alpj kusho

      Jjajajajjajajajaja ngiyabonga, impela isigaxa snoopy, hahajjajajajjjajaj

  2.   umagazine kusho

    Ngiyabonga..

  3.   UBubanzi kusho

    Gracias

  4.   i-ferchmetal kusho

    ngiyabonga!

  5.   izyokp kusho

    Lokhu akusebenzeli isinamoni angithi?

    1.    alpj kusho

      Angazi ukuthi ngingasishintsha kanjani isithombe sangemuva kusinamoni, kepha into eqinisekile ukuthi i-function rand_image ikusebenzela ukuthola isithombe esingahleliwe, ngakho-ke kufanele usidlulise $ dir_image
      Ake ngiphenye

  6.   + AMEM + kusho

    Ngiyabonga, ngiyishintshe kancanyana ngezizukulwane ezizayo ... ngithemba ukuthi awuzihluphi
    Ngingathanda ukwazi ukuthi ucabangani, angazi okuningi ngolimi

    #! / bin / bash

    # ~ Umbhali wangempela
    #~
    # ~ halonsov: Isazi sezibalo, isithandwa se-GNU / LINUX, uhlelo, uDebian nomsebenzisi we-xmonad.
    #~
    # ~ Izinkomba
    #~ https://blog.desdelinux.net/cambiar-automaticamente-el-fondo-de-pantalla-con-nitrogen/
    #~
    # ~ Yala ukusebenzisa iskripthi njalo ngemizuzwana engu-120
    # ~ bukela -i-120 / i-home / i-emamu / i-Backup / iDataCrunch/Synaptic/RandomWallpaper.sh
    #~
    # ~ Ukubambisana
    # ~ + AMEM +
    # ~ Ngokwami ​​ngincamela ukuyisebenzisa kanye kuphela ukuze ngingasebenzisi isikhala
    # ~ engeza ku-autostart.sh
    # ~ /home/amem/backup/DataCrunch/Synaptic/RandomWallpaper.sh &
    # ~ Inothi lomuntu siqu
    # ~ lo mbhalo ekuqaleni wenziwa yi-halonsov.
    # ~ Ngiyilungisile ukuze kube okuncane kuphela, ukuyikhipha ekuqaleni kwe- # CrunchBang!
    # ~ inhloso ukuthi zonke lezo zithombe onazo kwi-disk yakho ungazibona
    # ~ njalo kaningi, nokuthi bazijwayele kusikrini ngokuya ngezakhiwo zabo.
    # ~ yalombhalo ukhomba izici zokuqapha kwakho,
    # ~ nalezo zesithombe noma zesithombe sakho se- «directory»,
    # ~ ukuze usebenzise i-nitrogen + ukugwema ukukhulisa noma ukusondeza ipharamitha
    # ~ zinwetshiwe, izithombe zamaphikseli.
    # ~ Uma lo mbhalo ungahambelani nezidingo zakho, ungaguqula amapharamitha awo
    # ~ Isib i-nitrogen -isisekelo
    # ~ ukufaka isithombe ngaphandle kokukala
    # ~ Ngincoma ukuthi ufunde ibhukwana le-nitrogen.

    #Ukuqondiswa
    #Ikhombandlela yezithombe ezizosetshenziswa njengephepha lodonga, kufaka phakathi nemibhalo engezansi
    #Shintsha kumkhombandlela lapho kutholakala khona amaphephadonga akho
    # Isibqondisi = / ikhaya /… / izithombe
    umkhombandlela = / home / amem / images / Wallpaper

    # Isinqumo sokuqapha
    # Lo msebenzi uthola ukutholwa kokuqapha kwethu, bese ukugcine kokuguquguqukayo:
    sebenza my_resolution ()
    {
    #Sithola isixazululo semonitor yethu nge-xrandr
    res = `xrandr | grep '*' | grep -o -E '[0-9] + x [0-9] +' ``
    #Ukuphakama kwesiqapha
    i-my_high = `echo" $ res "| sika -d "x" -f 2`
    # Monitor ububanzi
    i-my_width = `echo" $ res "| sika -d "x" -f 1`
    }

    #Isithombe Esingahleliwe
    #Lo msebenzi uthola isithombe ngaphakathi "kwesiqondisi"
    umsebenzi rand_image ()
    {
    #Sithola igama lesithombe esithile ngaphakathi kwe- $ directory
    isithombe = `ls -1 -b -R" $ directory "| grep -i -e ".png" -e ".jpg" -e ".jpeg" | hlunga -okungahleliwe-hlunga | ikhanda -1`

    # KUBALULEKILE! Uma ubona sihlunga wonke amafayela nge- "extensions" .png, .jpg, .jpeg. Faka -e ".extension" njengoba kufanele.
    #Isibonelo:
    # isithombe = `ls -1 -b -R" $ lwemibhalo "| grep -i -e ".png" -e ".jpg" -e ".jpeg" -e ".new_extension" | hlunga -okungahleliwe-hlunga | ikhanda -1`

    #Sithola indlela yesithombe esingu- $
    image_dir = `find" $ directory "-iname" $ ​​image "`
    }

    # Isixazululo sesithombe
    # Lo msebenzi uthola ukulungiswa kwesithombe esitholwe umsebenzi we-rand_imagen ()
    sebenza image_resolution ()
    {
    mthandeni_sa
    #Sithola ukuphakama kwesithombe esingu- $
    high_image = `identify -format"% h "" $ image_dir "`
    #Sithola ububanzi besithombe esingu- $
    ububanzi_image = `identify -format"% w "" $ image_dir "`
    }

    #Sithola isilinganiso sesithombe_resolution / resolution_resolution
    # umphumela walesi sigaba ubuyisa inani elikhulu noma ngaphansi kuka-1
    # isilinganiso 1 isithombe sikhulu kunesikrini
    inani lomsebenzi ()
    {
    isixazululo sami_
    ukulungiswa kwesithombe_
    ratio_high = `echo $ image_high / $ my_high | bc -l`
    width_proportion = `echo $ width_image / $ my_width | bc -l`
    }

    #Sithola isilinganiso_high / image_width ratio
    # umphumela walesi sigaba ubuyisa inani elikhulu noma ngaphansi kuka-1; Ngaphandle kokuthi isithombe siyisikwele Oo
    # image_proportion 1 isithombe mude kunokubanzi
    umsebenzi wesilinganiso ()
    {
    ukulungiswa kwesithombe_
    ratio_image_reason = `echo $ tall_image / $ wide_image | bc -l`
    }

    #Setha isithombe sangemuva
    # Lo msebenzi uguqula imingcele ye-nitrogen ngokuya ngezici zesithombe maqondana nesiqapha
    #Image yinde kakhulu noma inkulu kunesikrini sethu Ibeka iphephadonga ngokukala isithombe
    Izindawo ze- # -Set-centered the image unscaled
    # –Set-scaled igcwalisa isikrini ngomfanekiso osontekile
    # –Set-zoom igcwalisa isikrini ngesithombe esilinganisiwe phezulu
    # –Setha-ukusondeza-ukugcwalisa kugcwalisa isikrini ngesithombe esilinganisiwe
    umsebenzi we-scalar ()
    {
    isilinganiso
    uma [`echo" $ width_proportion> 1 ″ | bc` -eq 1]; lapho-ke
    #Uma ukulungiswa kwesithombe kukhulu kunokwesikrini sethu, khipha ...
    i-nitrogen -set-scaled "$ image_dir"
    futhi
    uma [`echo" $ high_rate> 1 ″ | bc` -eq 1]; lapho-ke
    #Uma ukulungiswa kwesithombe kuncane kunokwesikrini sethu, khipha ...
    i-nitrogen -set-centered "$ image_dir"
    futhi
    #Uma isithombe sincane kunesikrini singasikhulisa sibe ubude noma ububanzi
    isilinganiso sesithombe
    uma [`echo« $ proportionimage_reason> 1 ″ | bc` -eq 1]; lapho-ke
    #Uma ukuphakama kwesithombe kuncane kunokwesikrini sethu, khipha ...
    i-nitrogen -setha-zoom "$ image_dir"
    futhi
    uma [`echo« $ proportionimage_reason <1 "| bc` -eq 1]; lapho-ke
    #Uma ububanzi besithombe bungaphansi kunesikrini sethu, khipha ...
    i-nitrogen -set-zoom-fill "$ image_dir"
    fi
    fi
    fi
    fi
    }

    gibela

    Phuma

    1.    UHalonso V kusho

      Kuhle kakhulu. Ngiyabonga.