Add script to get random wallpaper on sway startup
This commit is contained in:
20
bin/get-random-wallpaper.py
Executable file
20
bin/get-random-wallpaper.py
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
import random
|
||||||
|
|
||||||
|
homedir = os.environ['HOME']
|
||||||
|
|
||||||
|
wallpapers = glob.glob(f"{homedir}/Pictures/Wallpapers/*")
|
||||||
|
|
||||||
|
while True:
|
||||||
|
wallpaper = random.choice(wallpapers)
|
||||||
|
|
||||||
|
if wallpaper.__contains__("README.md"):
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
print(wallpaper)
|
||||||
|
|
||||||
11
sway/config
11
sway/config
@@ -39,13 +39,11 @@ set $ws10 "10"
|
|||||||
default_border none
|
default_border none
|
||||||
smart_borders on
|
smart_borders on
|
||||||
focus_follows_mouse no
|
focus_follows_mouse no
|
||||||
|
gaps inner 10
|
||||||
gaps inner 8
|
|
||||||
|
|
||||||
floating_modifier $mod normal
|
floating_modifier $mod normal
|
||||||
|
|
||||||
# Draw wallpaper
|
# Draw wallpaper
|
||||||
output * bg ~/Pictures/Wallpapers/2b.jpeg fill
|
output * bg `$HOME/dotfiles/bin/get-random-wallpaper.py` fill
|
||||||
|
|
||||||
# Keyboard layout
|
# Keyboard layout
|
||||||
input * {
|
input * {
|
||||||
@@ -86,7 +84,7 @@ for_window [class="MuPDF"] floating enable
|
|||||||
# /_/ \_\___/ |_| \___/|____/ |_/_/ \_\_| \_\|_|
|
# /_/ \_\___/ |_| \___/|____/ |_/_/ \_\_| \_\|_|
|
||||||
#
|
#
|
||||||
exec_always --no-startup-id $HOME/.config/waybar/launch.sh
|
exec_always --no-startup-id $HOME/.config/waybar/launch.sh
|
||||||
exec_always --no-startup-id mako
|
exec_always --no-startup-id dunst
|
||||||
exec_always --no-startup-id inactive-windows-transparency.py
|
exec_always --no-startup-id inactive-windows-transparency.py
|
||||||
|
|
||||||
|
|
||||||
@@ -111,6 +109,9 @@ bindsym XF86AudioPrev exec playerctl previous
|
|||||||
bindsym $mod+Home exec wlshot copy
|
bindsym $mod+Home exec wlshot copy
|
||||||
bindsym $mod+Shift+Home exec wlshot save
|
bindsym $mod+Shift+Home exec wlshot save
|
||||||
|
|
||||||
|
# Lock screen
|
||||||
|
bindsym $mod+Shift+s exec --no-startup-id swaylock -i `$HOME/dotfiles/bin/get-random-wallpaper.py` --font FiraCode
|
||||||
|
|
||||||
# Start a terminal
|
# Start a terminal
|
||||||
bindsym $mod+Return exec $term
|
bindsym $mod+Return exec $term
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user