Skip to content

Commit 8aec67e

Browse files
author
CluelessCatBurger
authored
Version 0.0.2: Multihead improvements, movement interpolation, new IPC protocol
2 parents 651e296 + 94074bc commit 8aec67e

42 files changed

Lines changed: 9695 additions & 2897 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
submodules: "recursive"
2323
- name: Install libwayland-dev
2424
run: |
25-
sudo DEBIAN_FRONTEND=noninteractive apt-get install libwayland-dev libwayland-bin
25+
sudo DEBIAN_FRONTEND=noninteractive apt-get install libwayland-dev libwayland-bin libarchive-dev
2626
- name: Clone wayland-protocols from gitlab
2727
run: |
2828
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols --branch 1.40

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PREFIX ?= /usr/local
1212

1313
override CFLAGS += -I$(SRCDIR) -I$(BUILDDIR) -Wall -Wextra -fno-strict-aliasing
1414
override CFLAGS += $(shell pkg-config --cflags wayland-client)
15-
override LDFLAGS += $(shell pkg-config wayland-client wayland-cursor --libs) -lm
15+
override LDFLAGS += $(shell pkg-config wayland-client wayland-cursor libarchive --libs) -lm
1616

1717
override WAYLAND_PROTOCOLS_DIR ?= $(shell pkg-config wayland-protocols --variable=pkgdatadir)
1818
override WAYLAND_SCANNER = $(shell pkg-config --variable=wayland_scanner wayland-scanner)
@@ -38,6 +38,7 @@ override WL_HEADERS := \
3838
override SRC := \
3939
$(wildcard $(SRCDIR)/*.c) \
4040
$(wildcard $(SRCDIR)/actions/*.c) \
41+
$(wildcard $(SRCDIR)/protocol/*.c) \
4142
$(WL_HEADERS:.h=.c)
4243

4344
override OBJS := $(SRC:$(SRCDIR)/%.c=$(BUILDDIR)/%.o)
@@ -79,14 +80,14 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.c Makefile
7980
$(CC) $(CFLAGS) -MMD -MF $(patsubst %.o, %.d, $@) -c $< -o $@
8081

8182
$(PLUGINS_TARGET): $(PLUGINS_OBJS)
82-
$(CC) $(shell pkg-config --cflags wayland-client) $(PLUGINS_SRC) -DPLUGINSUPPORT_IMPLEMENTATION -I$(BUILDDIR) -fPIC -shared -lm -o $(PLUGINS_TARGET)
83+
$(CC) $(CFLAGS) $(PLUGINS_SRC) -DPLUGINSUPPORT_IMPLEMENTATION -I$(BUILDDIR) -fPIC -shared -lm -o $(PLUGINS_TARGET)
8384

8485
# Rule to build the binary
8586
$(TARGET): $(OBJS)
8687
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
8788

8889
# Rule to build shimejictl
89-
$(UTILS_DIR)/shimejictl: $(SRCDIR)/shimejictl/shimejictl.py
90+
$(UTILS_DIR)/shimejictl: $(SRCDIR)/shimejictl/client.py
9091
mkdir utils
9192
$(PYTHON3) scripts/py-compose.py -s $< -o $@
9293

@@ -110,6 +111,9 @@ install: $(UTILS_DIR)/shimejictl
110111
install -d $(DESTDIR)$(PREFIX)/bin/
111112
install -m755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/
112113
install -m755 $(UTILS_DIR)/shimejictl $(DESTDIR)$(PREFIX)/bin/shimejictl
114+
install -d $(DESTDIR)$(PREFIX)/share/systemd/user/
115+
install -m644 systemd/wl_shimeji.socket $(DESTDIR)$(PREFIX)/share/systemd/user/
116+
install -m644 systemd/wl_shimeji.service $(DESTDIR)$(PREFIX)/share/systemd/user/
113117

114118
# Handle header dependency rebuild
115119
sinclude $(DEPS)

README.md

Lines changed: 78 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Shimejis on the screenshot by [paccha](https://linktr.ee/paccha_) and [Moneka](h
1717
- Arch: `pacman -S wayland`
1818
- wayland-protocols:
1919
- Arch: `pacman -S wayland-protocols`
20+
- libarchive:
21+
- Arch: `pacman -S libarchive`
22+
2023

2124
## Runtime requirements
2225
Your compositor should *at least* support xdg-shell, wlr-layer-shell protocols, and provide wl_subcompositor interface.
@@ -40,60 +43,82 @@ make install
4043

4144
# How to use
4245

43-
## Converting to shimeji-ee format
46+
## Converting to wl_shimeji format
47+
4448
First, you need to find some Shimeji-ee mascots. They are usually distributed as zip archives. You can find them on the internet.
45-
When you got shimejis of your choice, you need to convert them to the wl_shimeji format. Simplest way to do it is to use `shimejictl import` command.
49+
When you got shimejis of your choice, you need to convert them to the wl_shimeji format.
4650

4751
```sh
48-
shimejictl import /path/to/shimeji-ee.zip
52+
shimejictl convert /path/to/shimeji-ee.zip -O /some/output/directory
4953
```
5054

51-
It will convert all shimejis from img/ directory of the Shimeji-ee instance to the wl_shimeji format and save them to .local/share/wl_shimeji/shimejis/ directory.
55+
It will try to read the zip archive and will ask you to select which mascots you want to convert:
56+
```bash
57+
$ shimejictl convert "The Neuroling Collection v0.7.zip" -O output/
58+
Prototypes available for conversion:
59+
1. Weuron
60+
2. Vedaling
61+
3. Tuteling Cursor
62+
4. Tuteling
63+
5. Neuron
64+
6. Neuroling
65+
7. Eviling
66+
8. Evil Neuroling
67+
9. Broken Neuron
68+
69+
Enter prototypes index or name to convert (can be comma-separated or A to convert all)
70+
>
71+
```
5272

53-
## Summoning mascots
54-
After you converted your mascots, you can summon them to the screen, but first you need to know the name of the mascot you want to summon.
73+
When you selected mascot types that you need, shimejictl will convert them to the wl_shimeji format and will save them to the output directory with names like
74+
`Shimeji.{mascot_name}.wlshm`
5575

56-
```sh
57-
shimejictl list
58-
```
59-
It will print the list of all available mascots.
76+
# Importing .wlshm prototypes
6077

61-
Then you can summon mascots by three ways:
62-
1. By name, on random screen:
78+
After you successfully converted your mascots, you can import them to the wl_shimeji format using the following command:
6379
```sh
64-
shimejictl summon mascot_name
80+
shimejictl prototypes import /path/to/Shimeji.{first_name}.wlshm /path/to/Shimeji.{second_name}.wlshm ...
6581
```
66-
2. By name, on specific screen and position:
82+
83+
If prototype already exists, shimejictl will skip it unless -f is used.
84+
85+
# Listing available prototypes
86+
87+
You can list all available mascot prototypes using the following command:
6788
```sh
68-
shimejictl summon mascot_name --select
89+
shimejictl prototypes list
6990
```
70-
3. You can summon all known mascots at once (Note: it will only work if overlay is not running):
91+
92+
# Summoning mascots
93+
94+
To summon mascot, you need to know mascot's name, which you can get by using `shimejictl prototypes list` command. When you found mascot of your choice, you can summon using `shimejictl mascot summon {name}` command, where `{name}` is the name of the mascot you want to summon.
95+
96+
For example, if you want to summon a mascot named Neuron, you can use the following command:
7197
```sh
72-
shimejictl summon all
98+
shimejictl mascot summon Neuron
7399
```
74100

75-
All summon commands will start the overlay if it's not running.
101+
If you want to summon mascot at specific location, you can use --select flag or pass your coordinates as -x -y or -position x,y
76102

77103
## Dismissing mascots
78-
You can dismiss mascots by using `shimejictl dismiss` command.
79104

80-
```sh
81-
shimejictl dismiss
82-
```
83-
It will ask you to select the mascot you want to dismiss.
84-
Command also takes three flags:
85-
- `--all` - dismiss all mascots at once (mutually exclusive with `--all-other`)
86-
- `--all-other` - dismiss all mascots except the selected one (mutually exclusive with `--all`)
87-
- `--same` - tells overlay to target mascots of the same type as the selected one
105+
To dismiss mascot, you can use `shimejictl mascot dismiss` command.
106+
shimejictl will ask you to click on target mascot.
107+
Also we have flags that can be used to dismiss multiple mascots at once.
108+
Use shimejictl mascot dismiss --help to see all available flags.
88109

89-
So for example following command will dismiss all mascots:
90-
```sh
91-
shimejictl dismiss --all
92-
```
110+
## Setting mascots behaviors
111+
112+
You can replace mascot's behavior by using `shimejictl mascot set-behavior {behavior}` command, where `{behavior}` is the name of the behavior you want to set. shimejictl will ask you to click on target mascot.
113+
114+
You can get all available behaviors by using `shimejictl prototypes info {prototype_name}` command, where `{prototype_name}` is the name of the mascot prototype you want to get information about.
115+
116+
# Exporting prototypes
117+
118+
You can export mascot prototype by using `shimejictl prototypes export` command. It will produce .wlshm file that you can then share with others.
93119

94-
And this command will dismiss all mascots of the same type as the selected one:
95120
```sh
96-
shimejictl dismiss --all-other --same
121+
shimejictl prototypes export -i {prototype_name} -o {output_file}
97122
```
98123

99124
## Stopping application
@@ -115,61 +140,47 @@ Or values of all options by using `list` action:
115140
shimejictl config list
116141
```
117142

118-
Config file is usually located at .config/wl_shimeji/shimeji.conf
143+
Config file is usually located at .config/wl_shimeji/shimeji-overlayd.conf
119144

120145
# Advanced usage
121146

122-
## Using custom config path
123-
`shimejictl` takes `--config-path` argument to specify custom path to the configuration directory.
147+
## Multihead usage
124148

125-
## Converting mascots on individual basis
126-
You can convert mascots to the wl_shimeji format on individual basis by using `shimejictl convert` command.
149+
wl_shimeji supports multiple screens. However, some features may be disabled by default. Config provides following options:
150+
- ALLOW_THROWING_MULTIHEAD: Allows throwing mascot between screens
151+
- ALLOW_DRAGGING_MULTIHEAD: Allows dragging mascot between screens
152+
- UNIFIED_OUTPUTS: Treats all outputs as one entity
127153

128-
```sh
129-
shimejictl convert .../Shimeji-EE/img/mascot_name
130-
```
131-
Following command will convert mascot with the name `mascot_name` from the Shimeji-ee instance to the wl_shimeji format and save it to .local/share/wl_shimeji/shimejis/ directory.
132-
IMPORTANT: `convert` command doesn't have full instance context, so conf/ subdirectory with actions.xml and behaviors.xml inside the mascot directory *IS REQUIRED*.
154+
You may want block one of displays from being used by wl_shimeji in runtime, so we have `shimejictl environment close` to disable one of outputs. shimejictl will ask you to select one of outputs by clicking on it. After this operation, you can't restore display unless you restart wl_shimeji or reconnect display to the system.
133155

134-
## Getting mascot information
135-
Useful for debugging, `shimejictl info` command prints information about the selected mascot.
156+
## Interpolation
136157

137-
```sh
138-
shimejictl info
139-
```
158+
wl_shimeji supports movement interpolation of mascots. You can enable it by setting INTERPOLATION_FRAMERATE to value that is not equal to 0. Values > 0 used as interpolation frame rate. -1 Picks output's refresh rate as interpolation frame rate. Values under -1 are not allowed.
140159

141-
## Launching overlay in the foreground
142-
`shimejictl foreground` command launches overlay in the foreground.
160+
## Tablets
143161

144-
```sh
145-
shimejictl foreground
146-
```
162+
wl_shimeji recognized pentablets as input method, so you can use it as input device. However, currently subsurfaces bugged under KDE when using them with wp-tablet-v2, so you may want to disable that feature by setting TABLETS_ENABLED to false.
147163

148-
## Exporting configurations
149-
To export already converted mascots to a configuration pack, use the export subcommand. This will create a zip archive containing all mascots and their configurations, named export.wlshm in the current directory.
164+
## Mapping mouse buttons
150165

151-
```sh
152-
shimejictl export
153-
```
166+
You can map mouse button and tablet events (stylus down, stylus up) to different actions. For example you can remap right button to 0x01, so it will act as left button and etc.
154167

155-
You can also specify a custom output path by passing it as an argument:
156-
157-
```sh
158-
shimejictl export /path/to/output/file.wlshm
159-
```
168+
## Using systemd socket
160169

161-
You can import this configuration pack later by using `import` subcommand.
170+
wl_shimeji can be activated on-demand through systemd socket. To enable it, use 'systemctl --use enable wl_shimeji.socket'.
162171

163172
## Running overlay manually
164173
You can start overlay manually by running `shimeji-overlayd`. It's not recommended and *useless* in case you don't pass -se flag to it or
165174
if you don't pass unix fd using -cfd flag, unless you implementing another frontend for the overlay. If -se or -cfd not specified
166175
overlay will close immediately after start.
167176

168177
Arguments:
169-
- `-s` - path to the overlay socket file.
170-
- `-c` - path to the configuration directory.
178+
- `-s`, `--socket-path` - path to the overlay socket file.
179+
- `-cd`, `--configuration-root` - path to the configuration root of the wl_shimeji (/home/kotb/.local/share/wl_shimeji by default)
171180
- `-cfd`, `--caller-fd` - paired unix socket fd used for communication. If closed and no other clients connected nor no mascots exists, overlay will close.
172-
- `-p` - path to the plugins directory.
181+
- `-c` - config file path.
182+
- `-pl` - path to the plugins directory.
183+
- `-pr` - path to the prototypes directory.
173184
- `-se` - summon everyone. If specified, overlay will summon all known mascots upon start.
174185
- `-v`, `--version` - version of the overlay.
175186
- `--no-tablets` - disable wp_tablet_v2 wayland protocol support. (broken on kwin right now anyway)

0 commit comments

Comments
 (0)