Better wallpaper handling in Awesome with new tools from bin.org

This commit is contained in:
Lucien Cartier-Tilet 2020-06-14 20:53:27 +02:00
parent 6843dfbdbc
commit fa3faba5a2
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 31 additions and 5 deletions

View File

@ -368,9 +368,7 @@
[[https://github.com/l3ib/nitrogen/][Nitrogen]] and [[https://github.com/dylanaraps/pywal][Pywal]]. [[https://github.com/l3ib/nitrogen/][Nitrogen]] and [[https://github.com/dylanaraps/pywal][Pywal]].
#+BEGIN_SRC lua #+BEGIN_SRC lua
local function set_random_pape() local function set_random_pape()
papes = get_papes() awful.spawn.with_shell("pape-update")
pape = papes[math.random(#papes)]
awful.spawn.with_shell("nitrogen --set-scaled "..pape.." && wal -o wal-set -i "..pape)
naughty.notify({ preset = naughty.config.presets.normal, naughty.notify({ preset = naughty.config.presets.normal,
title = "Wallpaper change", title = "Wallpaper change",
text = "Done!"}) text = "Done!"})
@ -385,8 +383,7 @@
wallpaper: wallpaper:
#+BEGIN_SRC lua #+BEGIN_SRC lua
local function set_wallpaper(_) local function set_wallpaper(_)
awful.spawn.with_shell("nitrogen --set-scaled (cat $HOME/.cache/wal/wal)") awful.spawn.with_shell("wal -i (cat $HOME/.cache/wal/wal) && pape-restore")
awful.spawn.with_shell("wal -i (cat $HOME/.cache/wal/wal)")
awful.spawn.with_shell("xrdb $HOME/.Xresources") awful.spawn.with_shell("xrdb $HOME/.Xresources")
end end
#+END_SRC #+END_SRC

View File

@ -26,6 +26,8 @@
- [[#emoji-picker][Emoji picker]] - [[#emoji-picker][Emoji picker]]
- [[#lock][Lock]] - [[#lock][Lock]]
- [[#mp42webm][mp42webm]] - [[#mp42webm][mp42webm]]
- [[#pape-update][pape-update]]
- [[#pape-restore][pape-restore]]
- [[#pinfo][Pinfo]] - [[#pinfo][Pinfo]]
- [[#polybar-launch][Polybar-launch]] - [[#polybar-launch][Polybar-launch]]
- [[#rofi-mount][Rofi-mount]] - [[#rofi-mount][Rofi-mount]]
@ -431,6 +433,33 @@
ffmpeg -i $argv[1] -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis $argv[1].webm ffmpeg -i $argv[1] -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis $argv[1].webm
#+END_SRC #+END_SRC
* pape-update
:PROPERTIES:
:HEADER-ARGS: :tangle ~/.local/bin/pape-update
:CUSTOM_ID: pape-update-bdecbadf
:END:
This little tool updates my wallpaper using both pywal and nitrogen (because
apparently pywal doesnt like AwesomeWM). It depends on [[#pape-restore-981c39c2][~pape-restore~]].
#+BEGIN_SRC fish
#!/usr/bin/fish
wal -i ~/Pictures/Wallpapers
pape-restore
#+END_SRC
* pape-restore
:PROPERTIES:
:HEADER-ARGS: :tangle ~/.local/bin/pape-restore
:CUSTOM_ID: pape-restore-981c39c2
:END:
Similarly to ~pape-update~, this tool restores my wallpaper back to the same
state as I left it last time.
#+BEGIN_SRC fish
#!/usr/bin/fish
for i in (seq (xrandr --current | grep ' connected' | wc -l))
nitrogen --set-zoom-fill (cat ~/.cache/wal/wal) --head=(math "$i - 1")
end
#+END_SRC
* Pinfo * Pinfo
:PROPERTIES: :PROPERTIES:
:HEADER-ARGS: :tangle ~/.local/bin/pinfo :HEADER-ARGS: :tangle ~/.local/bin/pinfo