[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


>Linux is ugly
Oh yeah?
#!/bin/bash

# Function to set the background
set_background() {
feh --bg-fill "$1"
}

# Get current hour
hour=$(date +%H)

# Image directories
morning_dir="/path/to/your/images/morning"
afternoon_dir="/path/to/your/images/afternoon"
evening_dir="/path/to/your/images/evening"
night_dir="/path/to/your/images/night"

# Choose a random image from the appropriate directory
if [[ $hour -ge 6 && $hour -lt 12 ]]; then
image=$(ls "$morning_dir" | shuf -n1)
set_background "$morning_dir/$image"
elif [[ $hour -ge 12 && $hour -lt 18 ]]; then
image=$(ls "$afternoon_dir" | shuf -n1)
set_background "$afternoon_dir/$image"
elif [[ $hour -ge 18 && $hour -lt 22 ]]; then
image=$(ls "$evening_dir" | shuf -n1)
set_background "$evening_dir/$image"
else
image=$(ls "$night_dir" | shuf -n1)
set_background "$night_dir/$image"
fi
>>
File: cosmic.png (1.76 MB, 2560x1440)
1.76 MB
1.76 MB PNG
Changing the desktop background is never gonna make this shit NOT ugly as sin.
>>
>>101587235
That's pretty cool, anon. I have a similar script running every 10 minutes to change the wallpaper on each of my 3 monitors with a different folder for each monitor. I never thought of dividing them even further by time of day.
>>
morning_sir
afternoon_sir
evening_sir
night_sir
>>
>>101587381
I didn't even add imagrmagick for transitions
>>
>>101587396
for me it's just cron running it every 10 minutes
>>
>>101587235
As a Zoomer, I think pic related was a great cartoon.
>>
>>101587432
>cron
use systemd
>>
Where'd my post go?
>>
>>101587503
not him, but with cron i can easily run scripts at boot:
$ sudo crontab -e
@reboot /path/to/script
>>
>>101587648
with systemd it's just
systemctl enable name-of.service



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.