Compare commits
No commits in common. "main" and "v1.2.0" have entirely different histories.
11 changed files with 12 additions and 162 deletions
1
.fpm
1
.fpm
|
|
@ -3,5 +3,4 @@
|
||||||
--license agpl3
|
--license agpl3
|
||||||
--description "Wallpaper manager for i3"
|
--description "Wallpaper manager for i3"
|
||||||
--url "https://gitnet.fr/deblan/i3-wallpaper-manager"
|
--url "https://gitnet.fr/deblan/i3-wallpaper-manager"
|
||||||
--deb-recommends "feh"
|
|
||||||
--maintainer "Simon Vieille <contact+i3wallpapermanager@deblan.fr>"
|
--maintainer "Simon Vieille <contact+i3wallpapermanager@deblan.fr>"
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
name: New feature
|
|
||||||
about: Use this template if you want to request a feature
|
|
||||||
title: "[FEATURE] "
|
|
||||||
labels:
|
|
||||||
- Kind/Enhancement
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this feature request!
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: Describe the feature.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: benefits
|
|
||||||
attributes:
|
|
||||||
label: Benefits
|
|
||||||
description: Describe the benefits of this feature.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: extra
|
|
||||||
attributes:
|
|
||||||
label: More informations
|
|
||||||
description: If you want to share more things, this is here!
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
name: New issue
|
|
||||||
about: Use this template if you have a bug
|
|
||||||
title: "[Bug] "
|
|
||||||
labels:
|
|
||||||
- Kind/Bug
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this bug report!
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Environment
|
|
||||||
value: |
|
|
||||||
* i3 wallpaper manager version:
|
|
||||||
* i3-wm version:
|
|
||||||
* Operating system and version:
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: configuration
|
|
||||||
attributes:
|
|
||||||
label: Configuration
|
|
||||||
value: |
|
|
||||||
```
|
|
||||||
```
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: steps
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
description: How reproduce the bug?
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: resuts
|
|
||||||
attributes:
|
|
||||||
label: Observed Results
|
|
||||||
description: What happened?
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: expected
|
|
||||||
attributes:
|
|
||||||
label: Expected Results
|
|
||||||
description: What should happen?
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: extra
|
|
||||||
attributes:
|
|
||||||
label: More informations
|
|
||||||
description: If you want to share more things, this is here!
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
name: New question
|
|
||||||
about: Use this template when you don't know how to do something
|
|
||||||
title: "[Question] "
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill information.
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: environment
|
|
||||||
attributes:
|
|
||||||
label: Environment
|
|
||||||
value: |
|
|
||||||
* i3 wallpaper manager version:
|
|
||||||
* i3-wm version:
|
|
||||||
* Operating system and version:
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: question
|
|
||||||
attributes:
|
|
||||||
label: Question
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
blank_issues_enabled: true
|
|
||||||
contact_links:
|
|
||||||
- name: Documentation
|
|
||||||
url: https://gitnet.fr/deblan/i3-wallpaper-manager
|
|
||||||
about: Official documentation web site
|
|
||||||
- name: Ask a question in our Matrix room
|
|
||||||
about: If you prefer a chat-like conversation or in need for quick help, this might be an alternative to opening an issue.
|
|
||||||
url: https://matrix.to/#/!QDcaVhvLZlhptPkGVi:neutralnetwork.org?via=neutralnetwork.org
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
[Unreleased]
|
[Unreleased]
|
||||||
|
|
||||||
## v1.2.1
|
|
||||||
### Added
|
|
||||||
- Add debian packaging deb-recommends
|
|
||||||
### Fixed
|
|
||||||
- Fix #1: add cache of latest command to not run wallpaper update when it's already up to date
|
|
||||||
|
|
||||||
## v1.2.0
|
## v1.2.0
|
||||||
### Added
|
### Added
|
||||||
- Add `callback` option
|
- Add `callback` option
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# 🖥️ i3 Wallpaper Manager
|
# 🖥️ i3 wallpaper manager
|
||||||
|
|
||||||
**i3 Wallpaper Manager** is a command-line tool designed to change the wallpaper depending of active workspaces on [i3](https://i3wm.org/). This tool works on one or multiple screens.
|
**i3 wallpaper manager** is a command-line tool designed to change the wallpaper depending of active workspaces on [i3](https://i3wm.org/). This tool works on one or multiple screens.
|
||||||
|
|
||||||
<video controls src="https://deblan.gitnet.page/i3-wallpaper-manager/demo.webm" type="video/webm" width="50%"></video>
|
<video controls src="https://deblan.gitnet.page/i3-wallpaper-manager/demo.webm" type="video/webm" width="50%"></video>
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ DISPLAY=:0 i3-wallpaper-manager /path/to/config.yaml
|
||||||
To run it when i3 starts, add this to your i3 configuration:
|
To run it when i3 starts, add this to your i3 configuration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
exec --no-startup-id DISPLAY=:0 i3-wallpaper-manager /path/to/config.yaml
|
exec_always DISPLAY=:0 i3-wallpaper-manager /path/to/config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
If you wish to use a program other than `feh`, set the `callback` parameter by specifying the path to your script.
|
If you wish to use a program other than `feh`, set the `callback` parameter by specifying the path to your script.
|
||||||
|
|
@ -64,7 +64,6 @@ WALLPAPER_1="$2"
|
||||||
|
|
||||||
SCREEN_2="$3"
|
SCREEN_2="$3"
|
||||||
WALLPAPER_2="$4"
|
WALLPAPER_2="$4"
|
||||||
# etc.
|
|
||||||
|
|
||||||
# Do stuff...
|
# Do stuff...
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CallbackUpdateWallpapers(callback string, files, screens []string) *exec.Cmd {
|
func CallbackUpdateWallpapers(callback string, files, screens []string) (*exec.Cmd, error) {
|
||||||
args := []string{}
|
args := []string{}
|
||||||
|
|
||||||
for key, file := range files {
|
for key, file := range files {
|
||||||
|
|
@ -15,5 +15,5 @@ func CallbackUpdateWallpapers(callback string, files, screens []string) *exec.Cm
|
||||||
cmd := exec.Command(callback, args...)
|
cmd := exec.Command(callback, args...)
|
||||||
cmd.Env = os.Environ()
|
cmd.Env = os.Environ()
|
||||||
|
|
||||||
return cmd
|
return cmd, cmd.Run()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
feh.go
4
feh.go
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FehUpdateWallpapers(files []string) *exec.Cmd {
|
func FehUpdateWallpapers(files []string) (*exec.Cmd, error) {
|
||||||
args := []string{}
|
args := []string{}
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
|
|
@ -15,5 +15,5 @@ func FehUpdateWallpapers(files []string) *exec.Cmd {
|
||||||
cmd := exec.Command("feh", args...)
|
cmd := exec.Command("feh", args...)
|
||||||
cmd.Env = os.Environ()
|
cmd.Env = os.Environ()
|
||||||
|
|
||||||
return cmd
|
return cmd, cmd.Run()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
7
main.go
7
main.go
|
|
@ -16,21 +16,18 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
config, err := LoadConfiguration(os.Args[1])
|
config, err := LoadConfiguration(os.Args[1])
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] %s", err.Error())
|
log.Printf("[ERROR] %s", err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastCommand string
|
UpdateWallapers(config)
|
||||||
|
|
||||||
UpdateWallapers(config, &lastCommand)
|
|
||||||
|
|
||||||
for recv.Next() {
|
for recv.Next() {
|
||||||
event := recv.Event().(*i3.WorkspaceEvent)
|
event := recv.Event().(*i3.WorkspaceEvent)
|
||||||
|
|
||||||
if event.Change == "focus" {
|
if event.Change == "focus" {
|
||||||
UpdateWallapers(config, &lastCommand)
|
UpdateWallapers(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
wallpaper.go
14
wallpaper.go
|
|
@ -40,7 +40,7 @@ func GetOutputsWallpapers(config Config) ([]string, []string, error) {
|
||||||
return files, screens, nil
|
return files, screens, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateWallapers(config Config, lastCommand *string) {
|
func UpdateWallapers(config Config) {
|
||||||
files, screens, err := GetOutputsWallpapers(config)
|
files, screens, err := GetOutputsWallpapers(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] %s", err.Error())
|
log.Printf("[ERROR] %s", err.Error())
|
||||||
|
|
@ -50,22 +50,14 @@ func UpdateWallapers(config Config, lastCommand *string) {
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
|
|
||||||
if config.Callback == "" {
|
if config.Callback == "" {
|
||||||
cmd = FehUpdateWallpapers(files)
|
cmd, err = FehUpdateWallpapers(files)
|
||||||
} else {
|
} else {
|
||||||
cmd = CallbackUpdateWallpapers(config.Callback, files, screens)
|
cmd, err = CallbackUpdateWallpapers(config.Callback, files, screens)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.String() == *lastCommand {
|
|
||||||
log.Printf("[INFO] wallapaper(s) already up to date")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
err = cmd.Run()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] cmd=%s error=%s", cmd.String(), err.Error())
|
log.Printf("[ERROR] cmd=%s error=%s", cmd.String(), err.Error())
|
||||||
} else {
|
} else {
|
||||||
log.Printf("[SUCCESS] cmd=%s", cmd.String())
|
log.Printf("[SUCCESS] cmd=%s", cmd.String())
|
||||||
*lastCommand = cmd.String()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue