@@ -17,19 +17,19 @@ type Hyprpaper struct {
1717}
1818
1919// Name returns the name of this window manager or desktop environment
20- func (sb * Hyprpaper ) Name () string {
20+ func (hp * Hyprpaper ) Name () string {
2121 return "Hyprpaper"
2222}
2323
2424// ExecutablesExists checks if executables associated with this backend exists in the PATH
25- func (sb * Hyprpaper ) ExecutablesExists () bool {
25+ func (hp * Hyprpaper ) ExecutablesExists () bool {
2626 return which ("hyprpaper" ) != "" // && which("hyprctl") != ""
2727}
2828
2929// Running examines environment variables to try to figure out if this backend is currently running.
30- // Also sets sb .sock to an empty string or to a UNIX socket file.
31- func (sb * Hyprpaper ) Running () bool {
32- sb .sock = ""
30+ // Also sets hp .sock to an empty string or to a UNIX socket file.
31+ func (hp * Hyprpaper ) Running () bool {
32+ hp .sock = ""
3333
3434 inst := env .Str ("HYPRLAND_INSTANCE_SIGNATURE" )
3535 if inst == "" {
@@ -42,38 +42,38 @@ func (sb *Hyprpaper) Running() bool {
4242 }
4343
4444 if sock := path .Join ("/run/user/" + currentUser .Uid + "/hypr/" + inst + "/.hyprpaper.sock" ); exists (sock ) {
45- sb .sock = sock
45+ hp .sock = sock
4646 return true
4747 }
4848
4949 if sock := path .Join ("/tmp/hypr" , inst , ".hyprpaper.sock" ); exists (sock ) {
50- sb .sock = sock
50+ hp .sock = sock
5151 return true
5252 }
5353
54- return false // env.Contains("XDG_SESSION_DESKTOP", "Hyprland") || env.Contains("DESKTOP_SESSION", "hyprland")
54+ return false
5555}
5656
5757// SetMode will set the current way to display the wallpaper (stretched, tiled etc)
58- func (sb * Hyprpaper ) SetMode (mode string ) {
59- sb .mode = mode
58+ func (hp * Hyprpaper ) SetMode (mode string ) {
59+ hp .mode = mode
6060}
6161
6262// SetVerbose can be used for setting the verbose field to true or false.
6363// This will cause this backend to output information about what is is doing on stdout.
64- func (sb * Hyprpaper ) SetVerbose (verbose bool ) {
65- sb .verbose = verbose
64+ func (hp * Hyprpaper ) SetVerbose (verbose bool ) {
65+ hp .verbose = verbose
6666}
6767
6868// SetWallpaper sets the desktop wallpaper, given an image filename.
6969// The image must exist and be readable.
70- func (sb * Hyprpaper ) SetWallpaper (imageFilename string ) error {
70+ func (hp * Hyprpaper ) SetWallpaper (imageFilename string ) error {
7171 if ! exists (imageFilename ) {
7272 return fmt .Errorf ("no such file: %s" , imageFilename )
7373 }
7474
7575 // Connect to the Hyprpaper socket
76- sock , err := net .DialUnix ("unix" , nil , & net.UnixAddr {Name : sb .sock , Net : "unix" })
76+ sock , err := net .DialUnix ("unix" , nil , & net.UnixAddr {Name : hp .sock , Net : "unix" })
7777
7878 if err != nil {
7979 return err
@@ -88,8 +88,8 @@ func (sb *Hyprpaper) SetWallpaper(imageFilename string) error {
8888
8989 // Set the wallpaper mode
9090 mode := defaultMode
91- if sb .mode != "" {
92- mode = sb .mode
91+ if hp .mode != "" {
92+ mode = hp .mode
9393 }
9494
9595 switch mode {
0 commit comments