You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding support for variables and the source keyword would enable a DRY hyprland/paper config. Instead of having to write magic strings more than once in the config files, e.g. the wallpaper file paths as shown in the example in the readme, the example could look like this:
Example:
If your wallpapers are stored in ~/Pictures, then make sure you have already preloaded the desired wallpapers in hyprpaper.conf.
Hyperpaper supports sourcing variables just like hyprland, enabling sharing common variables and a DRY config.
~/.config/hypr/variables.conf
$w1 = ~/Pictures/myepicpng.png
$w2 = ~/Pictures/myepicpngToo.png
$w3 = ~/Pictures/myepicpngAlso.png
#... continue as desired, but be mindful of the impact on memory.
~/.config/hypr/hyprpaper.conf
source ~/.config/hypr/variables.conf
preload = $w1
preload = $w2
preload = $w3
#... continue as desired, but be mindful of the impact on memory.
The Hyprland config can sourced these shared variables, and use them in defining new variables for ease of reading and to be used as shortcuts in the bind command.:
~/.config/hypr/hyprland.conf
source ~/.config/hypr/variables.conf
$wc1 = hyprctl hyprpaper wallpaper "DP-1,$w1"
$wc2 = hyprctl hyprpaper wallpaper "DP-1,$w2"
$wc3 = hyprctl hyprpaper wallpaper "DP-1,$w3"
# yes, use quotes around desired monitor and wallpaper
#... continued with desired amount
With the variables created we can now "exec" the actions.
Remember in Hyprland we can bind more than one action to a key so in the case where we'd like to change the wallpaper when we switch workspace we have to ensure that the actions are bound to the same key such as...
~/.config/hypr/hyprland.conf
bind=SUPER,1,workspace,1 #Superkey + 1 switches to workspace 1
bind=SUPER,1,exec,$wc1 #SuperKey + 1 switches to wallpaper $w1 on DP-1 as defined in the variable
bind=SUPER,2,workspace,2 #Superkey + 2 switches to workspace 2
bind=SUPER,2,exec,$wc2 #SuperKey + 2 switches to wallpaper $w2 on DP-1 as defined in the variable
bind=SUPER,3,workspace,3 #Superkey + 3 switches to workspace 3
bind=SUPER,3,exec,$wc3 #SuperKey + 3 switches to wallpaper $w3 on DP-1 as defined in the variable
#... and so on
Because the default behavior in Hyprland is to also switch the workspace whenever movetoworkspace is used to move a window to another workspace you may want to include the following:
bind=SUPERSHIFT,1,movetoworkspace,1 #Superkey + Shift + 1 moves windows and switches to workspace 1
bind=SUPERSHIFT,1,exec,$wc1 #SuperKey + Shift + 1 switches to wallpaper $w1 on DP-1 as defined in the variable
#... and so on
The text was updated successfully, but these errors were encountered:
timblaktu
changed the title
Feature: Support importing conf with source keyword to enable sharing definitions with hyprland conf
Feature: Support variables and importing conf with source keyword to enable sharing definitions with hyprland conf
Aug 11, 2023
Can we get some feedback on this? It seems like a really reasonable feature request, especially the part about sourcing other parts of the config in the same way as in hyprland.conf. This would make it easier for third-party applications, such as GUI wallpaper setters, to permanently set a wallpaper. Having a separate config files for preloading and setting wallpapers would be much more manageable for programs to edit.
Adding support for variables and the
source
keyword would enable a DRY hyprland/paper config. Instead of having to write magic strings more than once in the config files, e.g. the wallpaper file paths as shown in the example in the readme, the example could look like this:Example:
If your wallpapers are stored in ~/Pictures, then make sure you have already preloaded the desired wallpapers in hyprpaper.conf.
Hyperpaper supports sourcing variables just like hyprland, enabling sharing common variables and a DRY config.
~/.config/hypr/variables.conf
~/.config/hypr/hyprpaper.conf
The Hyprland config can sourced these shared variables, and use them in defining new variables for ease of reading and to be used as shortcuts in the bind command.:
~/.config/hypr/hyprland.conf
With the variables created we can now "exec" the actions.
Remember in Hyprland we can bind more than one action to a key so in the case where we'd like to change the wallpaper when we switch workspace we have to ensure that the actions are bound to the same key such as...
~/.config/hypr/hyprland.conf
Because the default behavior in Hyprland is to also switch the workspace whenever movetoworkspace is used to move a window to another workspace you may want to include the following:
The text was updated successfully, but these errors were encountered: