-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathyks.sh
More file actions
executable file
·40 lines (27 loc) · 1.34 KB
/
Copy pathyks.sh
File metadata and controls
executable file
·40 lines (27 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Resmin indirileceği klasörü belirtin
download_folder="$(echo $HOME)"
# https://matematikdelisi.com/yks/sayac/images/tyt/tyt-sinavina-geri-sayim-kalan-gun-161.jpg
# Sayfanın HTML içeriğini çekin
# Hedef tarih
target_date="2026-06-20 10:15"
# Yıl-Ay-Gün Saat:Dakika şeklinde
# Hedef tarihi saniyeye çevirin
target_epoch=$(date -d "$target_date" +"%s")
# Şu anki tarihi saniyeye çevirin
current_epoch=$(date +"%s")
# Kalan süreyi hesaplayın
remaining_seconds=$((target_epoch - current_epoch))
remaining_days=$((remaining_seconds / 86400)) # 1 gün = 86400 saniye
if [ $remaining_days -lt 0 ]; then
printf " Hata: Belirlenen sınav tarihi çoktan geçmiş.\n Lütfen sonraki yks zamanını bu betik için düzenleyin veya geliştirici ile iletişime geçin.\n https://github.com/Metincloup/YKS-Timer-Walpaper/issues adresinde issue açabilirsiniz.\n"
exit 1
fi
curl -o "$download_folder/image.jpg" "https://matematikdelisi.com/yks/sayac/images/tyt/tyt-sinavina-geri-sayim-kalan-gun-$remaining_days.jpg"
if [ $(echo $DESKTOP_SESSION) = 'xfce' ]; then
# xfce için duvar kağıdını ayarlayın
xfconf-query -c xfce4-desktop -p $(xfconf-query -c xfce4-desktop -l | grep "workspace0/last-image") -s "$download_folder/image.jpg"
else
# Nitrogen ile duvar kağıdını ayarlayın
nitrogen --set-centered "$download_folder/image.jpg"
fi