Push code

This commit is contained in:
Astatin3
2024-03-10 14:31:56 -06:00
parent b8fb756274
commit 7687332639
225 changed files with 116 additions and 1 deletions
+5 -1
View File
@@ -1,2 +1,6 @@
# Sway-Wallpaper # Sway-Wallpaper
Random wallpapers with neofetch, for sway Random wallpapers with neofetch, for sway
Icons are from https://github.com/dharmx/walls
This is meant to be for my sway configuration
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

+111
View File
@@ -0,0 +1,111 @@
import subprocess
import datetime
import os
import random
from PIL import Image
from PIL import ImageFilter
from PIL import ImageFont
from PIL import ImageDraw
import PIL.ImageOps
try:
os.ulink("/tmp/wallpaper.png")
except:
x = None # Do nothing
#file = open("/home/astatin3/.config/sway/icon.txt","r")
#lines = file.readlines()
#file.close()
output = (subprocess.run(['neofetch', '--stdout'], capture_output=True, text=True).stdout).split("\n")
screenX = 0
screenY = 0
def getSubfolders(path):
try:
return os.listdir(path)
except:
return None
def getRandWallpaper():
wallpapers = getSubfolders("/home/astatin3/.config/sway/wallpapers/")
return "/home/astatin3/.config/sway/wallpapers/" + random.choice(wallpapers)
for i in range(0, len(output)-2, 1):
#lines[i] = lines[i][:-1] + output[i]
#print(lines[i])
if i == 0:
output[0] += f"at ({datetime.datetime.now().strftime('%m-%d %H:%M:%S')})"
if i == 8:
res = output[i].split(" ")[1].split("x")
screenX = int(res[0])
screenY = int(res[1])
#neofetch = "\n".join(lines)
icon = Image.open("/home/astatin3/.config/sway/icon.png").convert("RGBA")
iconsizeX, iconsizeY = icon.size
neofetch = "\n".join(output)
textSize = 0.01
iconscale = 0.0005
textoffsetX = 0.0 #Percentages
textoffsetY = -0.16
iconoffsetX = -0.145
iconoffsetY = -0.16
color = (199,0,57)
# color = (255, 255, 255)
# img = Image.new('RGB', (screenX, screenY), (31, 26, 32))
img = Image.open(getRandWallpaper()).resize((screenX, screenY)).convert("RGB")
solidColorImage = Image.new('RGBA', (screenX, screenY),color)
blackImage = Image.new('RGBA', (screenX, screenY),(0,0,0,255))
invertImg = PIL.ImageOps.invert(img).convert('LA').filter(ImageFilter.BoxBlur(2))
# invertImg = invertImg.filter(ImageFilter.FIND_EDGES)
mask = Image.new('RGBA', (screenX, screenY),(0, 0, 0, 0))
draw = ImageDraw.Draw(mask)
font = ImageFont.truetype("/home/astatin3/.config/sway/UbuntuMonoNerdFontMono-Regular.ttf", textSize*screenX)
draw.text((textoffsetX*screenX+screenX/2, textoffsetY*screenY+screenY/2),neofetch,color,font=font)
icon = icon.resize((round(iconscale*iconsizeX*screenY), round(iconscale*iconsizeY*screenY)), Image.Resampling.LANCZOS)
mask.paste(icon, (round(iconoffsetX*screenX+screenX/2), round(iconoffsetY*screenY+screenY/2)), icon)
# Outline
mask2 = Image.new('RGBA', (screenX, screenY),(0, 0, 0, 0))
d = 1
mask2.paste(mask, (d, d), mask)
mask2.paste(mask, (d, -d), mask)
mask2.paste(mask, (-d, d), mask)
mask2.paste(mask, (-d, -d), mask)
mask2.paste(mask, (d, 0), mask)
mask2.paste(mask, (-d, 0), mask)
mask2.paste(mask, (0, d), mask)
mask2.paste(mask, (0, -d), mask)
wallpaper = Image.composite(invertImg, img, mask2)
wallpaper = Image.composite(img, wallpaper, mask)
wallpaper.save("/tmp/wallpaper.png")
# img.save("/tmp/wallpaper.png")
#img.show()
subprocess.run(["swaybg", "-m", "fill", "-i", "/tmp/wallpaper.png"])
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Some files were not shown because too many files have changed in this diff Show More