Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 21d1d6a

Browse files
committed
Changed project name: fswww -> swww
1 parent dbd4d88 commit 21d1d6a

10 files changed

Lines changed: 78 additions & 78 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "fswww"
2+
name = "swww"
33
version = "0.1.0"
44
authors = ["Leonardo Gibrowski Faé <leonardo.fae44@gmail.com>"]
55
edition = "2018"

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The Final Solution to your Wayland Wallpaper Woes
1+
# A Solution to your Wayland Wallpaper Woes
22
### Efficient animated wallpaper daemon for wayland, controlled at runtime
33

44
## Dependencies
@@ -15,10 +15,10 @@
1515
- Up to date stable rustc compiler and cargo
1616

1717
To build, clone this directory and run:
18-
```bash
18+
```
1919
cargo build --release
2020
```
21-
Then, put the binary at `target/release/fswww` in your path.
21+
Then, put the binary at `target/release/swww` in your path.
2222
Optionally, autocompletion scripts for bash, zsh, fish and elvish are offered
2323
in the `completions` directory.
2424

@@ -35,12 +35,12 @@ There are two main reasons that compelled me to make this, the first, that
3535
[oguri](https://github.com/vilhalmer/oguri) hasn't updated in over a year as I
3636
am writting this (02 Feb 2022), despite there being serious problems with
3737
excess of memory use while displaying certain gifs (see [this](https://github.com/vilhalmer/oguri/issues/38),
38-
for example). The best alternative I've found for oguri was [mpvpaper](https://github.com/GhostNaN/mpvpaper),
38+
for example). The best alternative I've found for oguri was [mpvpaper](https://github.com/GhostNaN/mpvpaper),
3939
but if felt like quite the overkill for my purposes.
4040

41-
Comparing to `oguri`, `fswww` uses less cpu power to animate once it has cached
41+
Comparing to `oguri`, `swww` uses less cpu power to animate once it has cached
4242
all the frames in the animation. It should also be **significantly** more
43-
memory efficient (make sure to see the
43+
memory efficient (make sure to see the
4444
[Caveats/Limitations](#CaveatsLimitations) though).
4545

4646
The second is that, to my knowledge, there is no wallpaper daemon for wayland
@@ -52,33 +52,33 @@ makes switch from one image to the next to happen very abruptly.
5252
## Usage
5353

5454
Start by initializing the daemon:
55-
```bash
56-
fswww init
55+
```
56+
swww init
5757
```
5858
Then, simply pass the image you want to display:
59-
```bash
60-
fswww img <path/to/img>
59+
```
60+
swww img <path/to/img>
6161
6262
# You can also specify outputs:
63-
fswww img -o <outputs> <path/to/img>
63+
swww img -o <outputs> <path/to/img>
6464
6565
# Control how smoothly the transition will happen and/or it's frame rate
6666
# For the step, smaller values = more smooth. Default = 20
6767
# For the frame rate, default is 30.
68-
fswww img --transition-step <1 to 255> --transition-fps <1 to 255>
68+
swww img --transition-step <1 to 255> --transition-fps <1 to 255>
6969
```
7070
If you would like to know the valid values for *\<outputs\>* then you can query
7171
the daemon. This will also tell you what the current image being displayed is,
7272
as well as the dimensions detected for the outputs. If you need more detailed
7373
information, I would recommend using [wlr-randr](https://sr.ht/~emersion/wlr-randr/).
74-
```bash
75-
fswww query
74+
```
75+
swww query
7676
```
7777
Finally, to stop the daemon, kill it:
78-
```bash
79-
fswww kill
8078
```
81-
For a more complete description, run *fswww --help* or *fswww \<subcommand\>
79+
swww kill
80+
```
81+
For a more complete description, run *swww --help* or *swww \<subcommand\>
8282
--help*.
8383

8484
## Caveats/Limitations
@@ -87,15 +87,15 @@ I had a glorious name when I started this project, but alas, I couldn't quite
8787
get there, here are some issues with it:
8888

8989
- To initialize the daemon already displaying and image, use:
90-
```bash
91-
fswww init --img <path/to/img> # Do this
90+
```
91+
swww init --img <path/to/img> # Do this
9292
```
9393
Do **NOT** use something like:
94-
```bash
95-
fswww init && fswww img <path/to/img> # Don't do this
94+
```
95+
swww init && swww img <path/to/img> # Don't do this
9696
```
9797
As that might straight up not work. In particular, it tends to fail when using
98-
it in a compositor's init script (which is probably where you will want to
98+
it in a compositor's init script (which is probably where you will want to
9999
`init` the daemon).
100100
- Despite trying my best to make this as resource efficient as possible,
101101
**memory can still be an issue**. From my testing, this seems to be mostly
@@ -104,6 +104,6 @@ get there, here are some issues with it:
104104
Strangenly, it also seems that openning the same image again will *not*
105105
increase usage further. Still trying to understand what's going on here.
106106
- If the daemon exits in an unexpected way (for example, if you send SIGKILL to
107-
force its shutdown), it will leave a `fswww.socket` file behind in
108-
`$XDG_RUNTIME_DIR` (or `/tmp/fswww` if it isn't set). If you want to
107+
force its shutdown), it will leave a `swww.socket` file behind in
108+
`$XDG_RUNTIME_DIR` (or `/tmp/swww` if it isn't set). If you want to
109109
reinitialize the daemon, you will have to remove that file first.

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use clap_complete::{generate_to, Shell};
66
include!("src/cli.rs");
77

88
const COMPLETION_DIR: &str = "completions";
9-
const APP_NAME: &str = "fswww";
9+
const APP_NAME: &str = "swww";
1010

1111
fn main() -> Result<(), Error> {
1212
let outdir = completion_dir()?;
13-
let mut app = Fswww::command();
13+
let mut app = Swww::command();
1414

1515
let shells = [Shell::Bash, Shell::Zsh, Shell::Fish, Shell::Elvish];
1616
for shell in shells {

fix_zsh_completion.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This is script is necessary because, by default, the output of clap generate
44
# will give us an autocomplete file that won't suggest any files when you write
5-
# <fswww img>
5+
# <swww img>
66
# and then press 'TAB'.
77
#
88
# Bash seems to be fine, and I haven't tested neither fish nor elvish
@@ -17,5 +17,5 @@ SUPPORTED_FILES="*.png|*.jpg|*.jpeg|*.gif|*.bmp|*.tif|*.tiff|*.ico|*.webp|*.avif
1717
sed \
1818
-e "s/:path .*:/&_files -g \"$SUPPORTED_FILES\"/" \
1919
-e "s/:IMG:/&_files -g \"$SUPPORTED_FILES\"/g" \
20-
completions/_fswww > completions/tmp \
21-
&& mv completions/tmp completions/_fswww
20+
completions/_swww > completions/tmp \
21+
&& mv completions/tmp completions/_swww

src/cli.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ impl std::str::FromStr for Filter {
3131
}
3232

3333
#[derive(Parser, Serialize, Deserialize)]
34-
#[clap(version, name = "fswww")]
34+
#[clap(version, name = "swww")]
3535
///The Final Solution to your Wayland Wallpaper Woes
3636
///
37-
///Change what your monitors display as a background by controlling the fswww daemon at runtime.
37+
///Change what your monitors display as a background by controlling the swww daemon at runtime.
3838
///Supports animated gifs and putting different stuff in different monitors. I also did my best to
3939
///make it as resource efficient as possible.
40-
pub enum Fswww {
40+
pub enum Swww {
4141
///Fills the specified outputs with the given color.
4242
///
4343
///Defaults to filling all outputs with black.
@@ -49,7 +49,7 @@ pub enum Fswww {
4949
/// Initialize the daemon.
5050
///
5151
/// Exits if there is already a daemon running. We check thay by seeing if
52-
/// $XDG_RUNTIME_DIR/fswww.socket exists.
52+
/// $XDG_RUNTIME_DIR/swww.socket exists.
5353
Init {
5454
///Don't fork the daemon. This will keep it running in the current terminal.
5555
///
@@ -76,7 +76,7 @@ pub enum Fswww {
7676

7777
///Asks the daemon to print output information (names and dimensions).
7878
///
79-
///You may use this to find out valid values for the <fswww-img --outputs> option. If you want
79+
///You may use this to find out valid values for the <swww-img --outputs> option. If you want
8080
///more detailed information about your outputs, I would recommed trying wlr-randr.
8181
Query,
8282
}
@@ -108,10 +108,10 @@ pub struct Img {
108108
#[clap(short, long, default_value = "")]
109109
pub outputs: String,
110110

111-
///Filter to use when scaling images (run fswww img --help to see options).
111+
///Filter to use when scaling images (run swww img --help to see options).
112112
///
113113
///Note that image scaling can sometimes significantly increase RAM usage. If you want to use
114-
///as little RAM as possible, I recommend scaling the images before sending them to fswww
114+
///as little RAM as possible, I recommend scaling the images before sending them to swww
115115
///
116116
///Available options are:
117117
///

src/communication.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This module creates the Answer struct to send back stuff from the daemon, and also implements
22
//! some helper functions to make communication more streamlined
33
use crate::{
4-
cli::{Filter, Fswww},
4+
cli::{Filter, Swww},
55
daemon:: BgInfo
66
};
77
use serde::{Deserialize, Serialize};
@@ -39,9 +39,9 @@ impl Answer {
3939
}
4040
}
4141

42-
impl Fswww {
42+
impl Swww {
4343
pub fn send(&mut self, stream: &UnixStream) -> Result<(), String> {
44-
if let Fswww::Img(img) = self {
44+
if let Swww::Img(img) = self {
4545
img.path = match img.path.canonicalize() {
4646
Ok(p) => p,
4747
Err(e) => return Err(format!("Coulnd't get absolute path: {}", e)),
@@ -55,7 +55,7 @@ impl Fswww {
5555
img.transition_fps = 1;
5656
}
5757
}
58-
if let Fswww::Init { img: Some(img), .. } = self {
58+
if let Swww::Init { img: Some(img), .. } = self {
5959
*img = match img.canonicalize() {
6060
Ok(p) => p,
6161
Err(e) => return Err(format!("Coulnd't get absolute path: {}", e)),

src/daemon/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::{
2929
time::Duration,
3030
};
3131

32-
use crate::cli::{Clear, Fswww, Img};
32+
use crate::cli::{Clear, Swww, Img};
3333
use crate::Answer;
3434

3535
mod processor;
@@ -99,7 +99,7 @@ impl Bg {
9999
&surface,
100100
Some(output),
101101
zwlr_layer_shell_v1::Layer::Background,
102-
"fswww".to_owned(),
102+
"swww".to_owned(),
103103
);
104104

105105
layer_surface.set_anchor(zwlr_layer_surface_v1::Anchor::all());
@@ -336,7 +336,7 @@ fn get_socket_addr() -> PathBuf {
336336
let runtime_dir = if let Ok(dir) = std::env::var("XDG_RUNTIME_DIR") {
337337
dir
338338
} else {
339-
"/tmp/fswww".to_string()
339+
"/tmp/swww".to_string()
340340
};
341341

342342
let runtime_dir = Path::new(&runtime_dir);
@@ -345,7 +345,7 @@ fn get_socket_addr() -> PathBuf {
345345
fs::create_dir(runtime_dir).expect("Failed to create runtime dir...");
346346
}
347347

348-
runtime_dir.join("fswww.socket")
348+
runtime_dir.join("swww.socket")
349349
}
350350

351351
///bgs and display can't be moved into here because it causes a segfault
@@ -449,15 +449,15 @@ fn recv_socket_msg(
449449
loop_signal: &calloop::LoopSignal,
450450
proc: &mut Processor,
451451
) -> Result<(), String> {
452-
let request = Fswww::receive(&mut stream);
452+
let request = Swww::receive(&mut stream);
453453
let answer = match request {
454-
Ok(Fswww::Clear(clear)) => clear_outputs(&mut bgs, clear, proc),
455-
Ok(Fswww::Kill) => {
454+
Ok(Swww::Clear(clear)) => clear_outputs(&mut bgs, clear, proc),
455+
Ok(Swww::Kill) => {
456456
loop_signal.stop();
457457
Answer::Ok
458458
}
459-
Ok(Fswww::Img(img)) => send_processor_request(proc, &mut bgs, img),
460-
Ok(Fswww::Init { img, color, .. }) => {
459+
Ok(Swww::Img(img)) => send_processor_request(proc, &mut bgs, img),
460+
Ok(Swww::Init { img, color, .. }) => {
461461
if let Some(img) = img {
462462
let request = Img {
463463
path: img,
@@ -474,7 +474,7 @@ fn recv_socket_msg(
474474
Answer::Ok
475475
}
476476
}
477-
Ok(Fswww::Query) => Answer::Info(bgs.iter().map(|bg| bg.info.clone()).collect()),
477+
Ok(Swww::Query) => Answer::Info(bgs.iter().map(|bg| bg.info.clone()).collect()),
478478
Err(e) => Answer::Err(e),
479479
};
480480
answer.send(&stream)

src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use std::{
88
mod cli;
99
mod communication;
1010
mod daemon;
11-
use cli::Fswww;
11+
use cli::Swww;
1212
use communication::Answer;
1313

1414
fn main() -> Result<(), String> {
15-
let mut fswww = Fswww::parse();
16-
if let Fswww::Init { no_daemon, .. } = fswww {
15+
let mut swww = Swww::parse();
16+
if let Swww::Init { no_daemon, .. } = swww {
1717
if get_socket(1, 0).is_err() {
1818
spawn_daemon(no_daemon)?;
1919
if no_daemon {
@@ -25,12 +25,12 @@ fn main() -> Result<(), String> {
2525
}
2626

2727
let mut socket = get_socket(5, 100)?;
28-
fswww.send(&socket)?;
28+
swww.send(&socket)?;
2929
match Answer::receive(&mut socket)? {
3030
Answer::Err(msg) => return Err(msg),
3131
Answer::Info(info) => info.into_iter().for_each(|i| println!("{}", i)),
3232
Answer::Ok => {
33-
if let Fswww::Kill = fswww {
33+
if let Swww::Kill = swww {
3434
#[cfg(debug_assertions)]
3535
let tries = 20;
3636
#[cfg(not(debug_assertions))]
@@ -98,8 +98,8 @@ fn get_socket_path() -> PathBuf {
9898
let runtime_dir = if let Ok(dir) = std::env::var("XDG_RUNTIME_DIR") {
9999
dir
100100
} else {
101-
"/tmp/fswww".to_string()
101+
"/tmp/swww".to_string()
102102
};
103103
let runtime_dir = Path::new(&runtime_dir);
104-
runtime_dir.join("fswww.socket")
104+
runtime_dir.join("swww.socket")
105105
}

tests/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn make_test_imgs() {
4444
}
4545

4646
fn cmd() -> Command {
47-
Command::cargo_bin("fswww").unwrap()
47+
Command::cargo_bin("swww").unwrap()
4848
}
4949

5050
fn main() {

0 commit comments

Comments
 (0)