feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland

This commit is contained in:
Luxferre
2026-10-20 21:15:16 +03:00
parent ad012360c3
commit 7bab7b7a11
422 changed files with 63226 additions and 2342 deletions
+1
View File
@@ -37,6 +37,7 @@ overlay/rootfs/etc/skel/.ssh/
overlay/rootfs/root/.ssh/
# C/C++ & CMake build artifacts
/src/xlibre
src/**/build/
CMakeFiles/
CMakeCache.txt
+27 -34
View File
@@ -23,12 +23,16 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v
- `bootloader/loaders/8110.mbn` — signed Qualcomm Sahara/Firehose programmer (`05c6:9008`).
### 1.3 Integrated hardware & UX tweaks
1. **Native 1:1 `240x320` resolution & enlarged fonts**:
- Sway runs at `output * scale 1` (`SXMO_SWAY_SCALE=1`) with Xwayland disabled to save RAM.
- Enlarged fonts across all UI layers: `Sxmo 13` window titles and `24px` top bar, `34pt`/`14pt` Conky clock/date positioned cleanly above the Bananarchy emblem wallpaper, `15px` bold Wofi full-screen menus (`240x296`), `13pt` Foot terminal font, `220x28` Wob volume/brightness overlay, and `12pt` Dunst notifications.
1. **Native 1:1 `240x320` resolution, cross-compiled Xlibre, `Fira Code` ligatures & ultra-low-latency Sxmo X11 UI**:
- **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0)**: compiled specifically for ARMv7 Cortex-A7 (`-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-plt -fomit-frame-pointer`) with all 3D/GLX/Glamor/VGA/DGA/XVideo bloat stripped out, rootless `elogind` device management, and `modesetting` KMS + `ShadowFB` (`drmModeDirtyFB` partial rectangle SPI updates) with automatic software cursor fallback on `/dev/dri/card0` (`panel-mipi-dbi`).
- **Non-Nerd `Fira Code` with OpenType ligatures**: `Fira Code` (`font-fira-code`) is configured as the primary system and terminal font across Fontconfig, Xft, `st`, `dmenu`, `dwm`, `conky`, and `dunst`, with `DejaVu SansM Nerd Font` used strictly as a fallback for Private Use Area icon glyphs.
- **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=15`, alongside full `XIM` (`fcitx5-t9`) input support.
- **Patched `sxmo-dmenu` (`dmenu`) (`< 15 ms` startup)**: full-width `240x320` 9-line vertical menu (`lineheight = 26`, positioned flush at `Y = 24` right below the 24px `dwm` bar) with a `#383838` top search bar, `#005577` prompt badge, `#1c1c1c` item list, `XIM` (`XSetLocaleModifiers("")`, `XSetICFocus`, `Xutf8LookupString`) for live `fcitx5-t9` search filtering and `#` mode switching, C-level focus preservation (`prevfocuswin`), and direct Nokia keypad bindings.
- **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously.
2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**:
- Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`.
- Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `450ms` long-press `*` `Ctrl+` modifier latch.
- Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`, updating the live top-bar status indicator (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`) in real time.
- Locks the candidate popup bar to the bottom of the screen (`X = 1, Y = 290, W = 238, H = 30`) with fixed-width 28-character monospace formatting (`Fira Code 9.5`), so neither the popup window nor individual letters ever jump when cycling through candidates.
- Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `550ms` long-press `*` `Ctrl+` modifier latch.
3. **Bantam AI agent (`prebuilt/bantam/bantam`)**:
- Fetched from the latest `master` branch of `https://code.luxferre.top/luxferre/bantam-cpp`, cross-compiled for `armv7`, and installed to `/usr/bin/bantam` and `/usr/local/bin/bantam` (with no default `.bantam.cfg` pre-created).
4. **Mainline 6.12.1-msm8916 QDSP6 audio (loudspeaker, earpiece, MEMS & headset mics), voice call & LTE modem stack**:
@@ -114,46 +118,35 @@ sudo dd if=./images/bananarchy-nokia-argon.img of=/dev/sdX bs=4M status=progress
> - Pressing **End / Power (red)**, **Left softkey**, **Right softkey**, or **Call (green)** once.
#### 3.1.1 Window tiling modes & switching combos
By default, Sxmo Sway is configured with **`default_orientation vertical` (`splitv`)**, so opening multiple terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
By default, Sxmo `dwm` is configured with the **vertical bottom-stack (`bstack`, `TTT`)** layout as default, so opening multiple `st` terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
You can switch between **vertical (`splitv`, one under another)**, **horizontal (`splith`, side-by-side)**, and **tabbed (`tabbed`, full-screen tabs)** layouts — as well as switch focus between open terminals — using any of the following combos:
You can switch between **vertical stack (`TTT`, `bstack`)**, **horizontal tile (`[]=`, `tile`)**, **deck (`[D]`, `deck`)**, and **fullscreen monocle (`[M]`, `monocle`)** layouts — as well as switch focus between open terminals — using any of the following combos:
1. **Direct physical keypad combos**:
- **Triple-press Call (green) (`3× Call`)**: cycles the current container layout (`vertical splitv` -> `horizontal splith` -> `tabbed` -> `vertical splitv`).
- **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (e.g., jumps between the top and bottom terminals).
- **Triple-press (or hold `400ms`) End / Power (red) (`3× End`)**: opens a new `Foot` terminal tiled in the active layout.
2. **Terminal context menu (`Right softkey` or `1× Call (green)` inside `Foot`)**:
- **Next window**: switch focus to the next open terminal/window.
- **Toggle layout**: cycle `splitv` -> `splith` -> `tabbed`.
- **Tile vertical**: immediately arrange open windows vertically (one under another) and set future splits to vertical.
- **Tile horizontal**: immediately arrange open windows horizontally (side-by-side) and set future splits to horizontal.
- **New terminal** / **Close terminal**: open a new terminal or close the focused terminal.
3. **System windows menu (`Left softkey` -> `Windows`)**:
- **Next window**: focus the next window in the workspace.
- **`splitv -> splith -> tabbed`**: cycle container layout mode.
- **Split vertical** / **Split horizontal** / **Tabbed layout**: switch directly to the chosen layout.
- **Switch menu** / **Move menu** / **Kill window**: switch to any window across workspaces, move windows between positions/workspaces, or close the focused window.
4. **External keyboard / `swaymsg` (`$mod` = `Mod4` / `Super`)**:
- `Mod4+v`: vertical split (`splitv`)
- `Mod4+b`: horizontal split (`splith`)
- `Mod4+e`: toggle split orientation (`layout toggle split` between vertical and horizontal)
- `Mod4+w`: tabbed layout (`layout tabbed`)
- `Mod4+s`: stacking layout (`layout stacking`)
- `Mod4+f`: toggle fullscreen (`fullscreen`)
- `Mod4+Up` / `Mod4+Down` / `Mod4+Left` / `Mod4+Right`: move focus between tiled windows
- `Mod4+Shift+Up` / `Mod4+Shift+Down` / `Mod4+Shift+Left` / `Mod4+Shift+Right`: reposition focused window
- **Triple-press Call (green) (`3× Call`)**: cycles the current DWM layout (`TTT` -> `[]=` -> `[D]` -> `[M]` -> `TTT`).
- **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (`Super+j`).
- **Triple-press End / Power (red) (`3× End`)**: opens a new `st` terminal (with HarfBuzz `Fira Code` ligature support) tiled in the active layout.
2. **External keyboard / `xdotool` (`MODKEY` = `Mod4` / `Super`)**:
- `Mod4+space`: cycle layout (`TTT` -> `[]=` -> `[D]` -> `[M]`)
- `Mod4+Shift+slash`: vertical stack layout (`bstack`, `TTT`)
- `Mod4+slash`: horizontal tile layout (`tile`, `[]=`)
- `Mod4+m`: fullscreen monocle layout (`monocle`, `[M]`)
- `Mod4+Up` / `Mod4+Down` (or `Mod4+k` / `Mod4+j`): move focus between tiled windows
- `Mod4+Shift+k` / `Mod4+Shift+j`: move focused window up/down in the stack
- `Mod4+1`..`4`: switch to workspace tag `1`..`4`
- `Mod4+Shift+q`: close focused window
### 3.2 Multi-mode `fcitx5-t9` keypad reference
- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `900ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
- **Auto-commit timeout**: `600ms` for keys with `<= 10` candidates, or `750ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `1500ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
- **Auto-commit timeout**: `1500ms` for keys with `<= 10` candidates, or `1800ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
- **While a candidate is highlighted (`[item]`) in preedit**:
- Press **`#`** or **D-Pad `Up`**: toggles letter case (`a` <-> `A`) on the fly without changing mode, or jumps forward **`+4` candidates** for non-alphabetic items.
- Press **D-Pad `Down`**: toggles letter case (`a` <-> `A`) for alphabetic items, or jumps backward **`-4` candidates** for non-alphabetic items.
- Press **D-Pad `Left`**: steps backward **1 candidate** on the same key.
- Press **D-Pad `Right`** or **Center `OK` (`Return`)**: commits the highlighted candidate immediately.
- Press **`BackSpace`**: cancels the uncommitted preedit candidate without deleting previously committed text.
- **Long-press (`>= 450ms`)**:
- **Long-press (`>= 550ms`)**:
- **Hold `0`–`9`**: commits the digit (`0`–`9`) immediately in any mode.
- **Hold `*`**:
- In `123` mode: commits a decimal point (`.`) immediately.
@@ -230,7 +223,7 @@ You can switch between **vertical (`splitv`, one under another)**, **horizontal
ssh user@172.16.42.1
```
- **Bantam AI agent**:
Run `bantam` in the terminal (`Foot`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
Run `bantam` in the terminal (`st`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
---
+21 -2
View File
@@ -6,7 +6,7 @@
See [The Bananarchy Manifesto](./MANIFESTO.md) for the rationale behind this entire project.
Bananarchy targets the **Sxmo (`sxmo-de-sway`)** environment exclusively, tuned for 1:1 native `240x320` resolution, enlarged high-contrast typography, sub-115 MB idle RAM footprint on 512 MB devices, full Qualcomm QDSP6/Q6Voice audio (loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias and +6 dB EAR PA gain), GSM/WCDMA/LTE modem routing (`ModemManager` + `q6voiced`), rear 2MP camera support (`msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and `bananarchy-photo` CLI/Sxmo app), pre-integrated **Bantam** AI agent (`https://code.luxferre.top/luxferre/bantam-cpp`), a complete on-device development & scripting stack (`git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, `v4l-utils`), and a custom **6-mode `fcitx5-t9` input engine** supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry.
Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment (with all Wayland components removed) powered by a cross-compiled **Xlibre (`X11Libre/xserver` 25.2.0)** display server (`modesetting` KMS + `ShadowFB` Damage partial-rectangle SPI transfers, software cursor fallback, rootless `elogind`), **patched `sxmo-dwm`** (`240x320` vertical `bstack` layout, 24px Pango status bar with overflow-protected right-aligned clock, direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`), **patched `sxmo-dmenu`** (`240x320` full-width 9-line vertical menu flush below the 24px top bar with `#383838` search bar, `#005577` prompt badge, and `XIM` `fcitx5-t9` text input in `< 15 ms`), **patched `sxmo-st`** terminal (`pixelsize=15`) with **HarfBuzz (`libharfbuzz`) OpenType ligature shaping** (`liga`, `calt`, `clig`, `dlig`) and `XIM` support, and **non-Nerd `Fira Code` (`font-fira-code`) with ligatures** as the primary system and terminal font (with `DejaVu SansM Nerd Font` used strictly as an icon fallback). It features a sub-95 MB idle RAM footprint on 512 MB devices, full Qualcomm QDSP6/Q6Voice audio (loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias and +6 dB EAR PA gain), GSM/WCDMA/LTE modem routing (`ModemManager` + `q6voiced`), rear 2MP camera support (`msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and `bananarchy-photo` CLI/Sxmo app), pre-integrated **Bantam** AI agent (`https://code.luxferre.top/luxferre/bantam-cpp`), a complete on-device development & scripting stack (`git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, `v4l-utils`), and a custom **6-mode `fcitx5-t9` input engine** with a fixed bottom candidate bar (`X=1, Y=290, W=238, H=30`) supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry with live top-bar mode indication (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`).
The current Bananarchy version is `v0.0.1`.
@@ -65,21 +65,34 @@ bananarchy/
│ │ └── 0001-edl-msm8909-32bit-elf-and-multi-cmd-firehose.patch
│ ├── sxmo/
│ │ └── 0001-bananarchy-sxmo-240x320-keypad-ui.patch
│ ├── xlibre/
│ │ ├── 0001-xlibre-msm8905-spi-drm-and-shared-vt.patch
│ │ ├── 0002-xf86-input-libinput-xlibre25.patch
│ │ └── 0003-xf86-video-fbdev-xlibre25.patch
│ └── fcitx5-t9/
│ └── 0001-bananarchy-multimode-t9-and-fcitx5-5.1.19.patch
├── src/
│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, direct C SW_LID & locked-key wake)
│ ├── sxmo-dmenu/ # Patched sxmo-dmenu (240x320 vertical 9-line menu, #383838 search bar, XIM fcitx5-t9)
│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligature shaping & XIM
│ ├── xf86-input-libinput/ # X11Libre xf86-input-libinput DDX driver
│ ├── xf86-video-fbdev/ # X11Libre xf86-video-fbdev fallback DDX driver
│ ├── fcitx5-t9/ # C++20 source of Bananarchy's 6-mode fcitx5-t9 input method
│ ├── leds-msm8905-torch/ # Kernel driver for SY7807 rear torch LED, WCD codec init & PM8909 PON shutdown
│ └── msm8905-cam/ # Kernel V4L2 driver for GC2395 2MP rear camera & MSM8909 CAMSS (/dev/video0)
├── overlay/
│ └── rootfs/ # Complete Bananarchy rootfs overlay (OS branding, Sxmo, audio, camera, T9)
│ └── rootfs/ # Complete Bananarchy rootfs overlay (OS branding, Sxmo X11, audio, camera, T9)
├── prebuilt/
│ ├── xlibre/ # Prebuilt armv7 Xlibre Xorg binary and modesetting/libinput/fbdev DDX modules
│ ├── sxmo-x11/ # Prebuilt armv7 patched dwm, dmenu, and st (with HarfBuzz ligatures)
│ ├── kernel-6.12.1-msm8916/ # Prebuilt QDSP6/Q6Voice .ko, torch .ko, camera .ko, and 5 device DTBs
│ ├── fcitx5-t9/ # Prebuilt armv7 libt9.so and fcitx5 addon/inputmethod configs
│ └── bantam/ # Prebuilt armv7 bantam AI agent binary
└── scripts/
├── generate-artwork.py # Generates all wallpapers, icons, and splashes from icon-large.png
├── mipi-dbi-cmd.py # Compiles MIPI-DBI panel .txt init sequences into .bin firmware
├── build-xlibre.sh # Cross-compiles Xlibre + xf86-input-libinput + xf86-video-fbdev for armv7 Cortex-A7
├── build-sxmo-x11.sh # Cross-compiles patched sxmo-st (HarfBuzz ligatures), sxmo-dmenu (XIM), and sxmo-dwm
├── build-kernel-audio.sh # Cross-compiles Linux 6.12.1-msm8916 QDSP6/torch/camera modules & DTBs
├── build-fcitx5-t9.sh # Cross-compiles src/fcitx5-t9 for armv7
├── build-bantam.sh # Fetches master from https://code.luxferre.top/luxferre/bantam-cpp & cross-compiles for armv7
@@ -100,6 +113,12 @@ Whenever `artwork/icon-large.png` is updated, regenerate all icons, `240x320` wa
### 2. Recompile core components (optional — prebuilts included)
All components are pre-compiled in `prebuilt/` and `overlay/rootfs/`, and can be rebuilt from source at any time using rootless Docker (`alpine:3.24`):
```bash
# Rebuild cross-compiled Xlibre (X11Libre/xserver) + libinput/fbdev DDX drivers
./scripts/build-xlibre.sh
# Rebuild patched sxmo-st (HarfBuzz Fira Code ligatures), sxmo-dmenu (XIM), and sxmo-dwm
./scripts/build-sxmo-x11.sh
# Rebuild multi-mode fcitx5-t9 input engine (src/fcitx5-t9 -> prebuilt/fcitx5-t9)
./scripts/build-fcitx5-t9.sh
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/X -nocursor -nolisten tcp "$@"
@@ -0,0 +1,47 @@
Section "ServerFlags"
Option "AutoAddDevices" "true"
Option "AutoEnableDevices" "true"
Option "AutoAddGPU" "false"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
Section "Device"
Identifier "MSM8909 SPI Panel"
Driver "modesetting"
Option "kmsdev" "/dev/dri/card0"
Option "AccelMethod" "none"
Option "ShadowFB" "true"
Option "SWCursor" "true"
Option "PageFlip" "false"
EndSection
Section "Screen"
Identifier "DefaultScreen"
Device "MSM8909 SPI Panel"
DefaultDepth 24
EndSection
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
+4
View File
@@ -1,8 +1,12 @@
permit persist :wheel
permit nopass :wheel as root cmd busybox args poweroff
permit nopass :wheel as root cmd busybox args reboot
permit nopass :wheel as root cmd /bin/busybox args poweroff
permit nopass :wheel as root cmd /bin/busybox args reboot
permit nopass :wheel as root cmd poweroff
permit nopass :wheel as root cmd reboot
permit nopass :wheel as root cmd /sbin/poweroff
permit nopass :wheel as root cmd /sbin/reboot
permit nopass :wheel as root cmd sxmo_wifitoggle.sh
permit nopass setenv { SXMO_OS } :wheel as root cmd sxmo_bluetoothtoggle.sh
permit nopass :wheel as root cmd rc-service args bluetooth restart
+10
View File
@@ -0,0 +1,10 @@
[Login]
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
[Sleep]
AllowSuspendInterrupts=yes
+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias binding="strong">
<family>DejaVu SansM Nerd Font</family>
<prefer>
<family>DejaVuSansM Nerd Font</family>
</prefer>
</alias>
<alias binding="strong">
<family>Sxmo</family>
<prefer>
<family>Fira Code</family>
<family>DejaVuSansM Nerd Font</family>
</prefer>
</alias>
<alias binding="strong">
<family>monospace</family>
<prefer>
<family>Fira Code</family>
<family>DejaVuSansM Nerd Font</family>
</prefer>
</alias>
<alias binding="strong">
<family>sans-serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVuSansM Nerd Font</family>
</prefer>
</alias>
<alias binding="strong">
<family>serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVuSansM Nerd Font</family>
</prefer>
</alias>
</fontconfig>
@@ -0,0 +1,8 @@
polkit.addRule(function(action, subject) {
if ((action.id.indexOf("org.freedesktop.ModemManager1.") == 0 ||
action.id.indexOf("org.freedesktop.login1.") == 0 ||
action.id.indexOf("org.freedesktop.NetworkManager.") == 0) &&
(subject.isInGroup("plugdev") || subject.isInGroup("wheel"))) {
return polkit.Result.YES;
}
});
@@ -0,0 +1,9 @@
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
+206
View File
@@ -0,0 +1,206 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script is meant to be sourced on login shells
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
_sxmo_is_running() {
unset SXMO_WM
_XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
if pidof -s dwm >/dev/null 2>&1 || DISPLAY=:0 xset q >/dev/null 2>&1; then
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
[ -z "$DISPLAY" ] && export DISPLAY=:0
unset _XDG_RUNTIME_DIR
return 0
fi
if [ -f "${_XDG_RUNTIME_DIR}"/sxmo.swaysock ]; then
if SWAYSOCK="$(cat "${_XDG_RUNTIME_DIR}"/sxmo.swaysock)" swaymsg 2>/dev/null
then
printf "Detected the Sway environment\n" >&2
export SXMO_WM=sway
unset _XDG_RUNTIME_DIR
return 0
fi
elif [ -e "$XDG_RUNTIME_DIR"/dbus.bus ] && pidof river > /dev/null; then
printf "Detected the River environment\n" >&2
export SXMO_WM=river
unset _XDG_RUNTIME_DIR
return 0
fi
if [ -f "${_XDG_RUNTIME_DIR}"/sxmo.i3sock ]; then
if I3SOCK="$(cat "${_XDG_RUNTIME_DIR}"/sxmo.i3sock)" i3-msg 2>/dev/null
then
printf "Detected the i3 environment\n" >&2
export SXMO_WM=i3
unset _XDG_RUNTIME_DIR
return 0
fi
fi
unset _XDG_RUNTIME_DIR
printf "Sxmo is not running\n" >&2
return 1
}
_sxmo_find_runtime_dir() {
# Take what we gave to you
if [ -n "$XDG_RUNTIME_DIR" ]; then
printf %s "$XDG_RUNTIME_DIR"
return
fi
# Try something existing
for root in /run /var/run; do
for path in "$root/user-$(id -u)" "$root/user/$(id -u)"; do
if [ -d "$path" ] && [ -w "$path" ]; then
printf %s "$path"
return
fi
done
done
if command -v mkrundir > /dev/null 2>&1; then
mkrundir
return
fi
# Fallback to a shared memory location
printf "/dev/shm/user/%s" "$(id -u)"
}
_sxmo_load_environments() {
if [ -e /etc/os-release ]; then
# shellcheck source=/dev/null
. /etc/os-release
elif [ -e /usr/lib/os-release ]; then
# shellcheck source=/dev/null
. /usr/lib/os-release
fi
export SXMO_OS="${ID:-unknown}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
export XDG_RUNTIME_DIR
export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
export SXMO_CACHEDIR="${SXMO_CACHEDIR:-$XDG_CACHE_HOME/sxmo}"
export SXMO_BLOCKDIR="${SXMO_BLOCKDIR:-$XDG_DATA_HOME/sxmo/block}"
export SXMO_BLOCKFILE="${SXMO_BLOCKFILE:-$XDG_CONFIG_HOME/sxmo/block.tsv}"
export SXMO_CONTACTFILE="${SXMO_CONTACTFILE:-$XDG_CONFIG_HOME/sxmo/contacts.tsv}"
export SXMO_STATE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
export SXMO_LOGDIR="${SXMO_LOGDIR:-$XDG_DATA_HOME/sxmo/modem}"
export SXMO_NOTIFDIR="${SXMO_NOTIFDIR:-$XDG_DATA_HOME/sxmo/notifications}"
export BEMENU_OPTS="${BEMENU_OPTS:---fn "Fira Code 9" -H 22 -B 2 --hp 4 -s --no-overlap --fixed-height --scrollbar none --cw 2 --bdr "#005577" --tb "#383838" --tf "#aaaaaa" --fb "#383838" --ff "#ffffff" --cb "#ffffff" --cf "#383838" --nb "#1c1c1c" --nf "#ffffff" --ab "#1c1c1c" --af "#ffffff" --hb "#005577" --hf "#ffffff" -w -i}"
export EDITOR="${EDITOR:-vim}"
export BROWSER="${BROWSER:-firefox}"
export SHELL="${SHELL:-/bin/sh}"
PATH="$HOME/.local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
export PATH
if [ -z "$SXMO_DEVICE_NAME" ]; then
if [ -e /proc/device-tree/compatible ]; then
SXMO_DEVICE_NAME="$(tr -c '\0[:alnum:].,-' '_' < /proc/device-tree/compatible |
tr '\0' '\n' | head -n1)"
else
SXMO_DEVICE_NAME=desktop
fi
fi
export SXMO_DEVICE_NAME
deviceprofile="$(command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh")"
# shellcheck disable=SC1090
if [ -f "$deviceprofile" ]; then
. "$deviceprofile"
printf "deviceprofile file %s loaded.\n" "$deviceprofile"
else
printf "WARNING: deviceprofile file not found for %s. Most device functions will not work. Please read: https://sxmo.org/deviceprofile \n" "$SXMO_DEVICE_NAME"
touch "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend
touch "$XDG_CACHE_HOME"/sxmo/sxmo.noidle
fi
unset deviceprofile
PATH="\
$HOME/.local/bin:\
$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME:\
$XDG_CONFIG_HOME/sxmo/hooks:\
$(xdg_data_path "sxmo/default_hooks" 0 ':'):\
$PATH"
export PATH
}
_sxmo_grab_session() {
if ! _sxmo_is_running; then
return
fi
XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
export XDG_RUNTIME_DIR
_sxmo_load_environments
if [ -f "$XDG_RUNTIME_DIR"/dbus.bus ]; then
DBUS_SESSION_BUS_ADDRESS="$(cat "$XDG_RUNTIME_DIR"/dbus.bus)"
export DBUS_SESSION_BUS_ADDRESS
if ! dbus-send --dest=org.freedesktop.DBus \
/org/freedesktop/DBus org.freedesktop.DBus.ListNames \
2> /dev/null; then
printf "WARNING: The dbus-send test failed with DBUS_SESSION_BUS_ADDRESS=%s. Unsetting...\n" "$DBUS_SESSION_BUS_ADDRESS" >&2
unset DBUS_SESSION_BUS_ADDRESS
fi
else
printf "WARNING: No dbus cache file found at %s/dbus.bus.\n" "$XDG_RUNTIME_DIR" >&2
fi
case "$SXMO_WM" in
dwm)
[ -z "$DISPLAY" ] && export DISPLAY=:0
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
;;
sway)
if [ -f "$XDG_RUNTIME_DIR"/sxmo.swaysock ]; then
SWAYSOCK="$(cat "$XDG_RUNTIME_DIR"/sxmo.swaysock)"
export SWAYSOCK
fi
;;
i3)
if [ -f "$XDG_RUNTIME_DIR"/sxmo.i3sock ]; then
I3SOCK="$(cat "$XDG_RUNTIME_DIR"/sxmo.i3sock)"
export I3SOCK
fi
;;
esac
}
_sxmo_prepare_dirs() {
uid=$(id -u)
gid=$(id -g)
mkdir -p "$XDG_RUNTIME_DIR"
chmod 700 "$XDG_RUNTIME_DIR"
chown "$uid:$gid" "$XDG_RUNTIME_DIR"
mkdir -p "$XDG_CACHE_HOME/sxmo/"
chmod 700 "$XDG_CACHE_HOME"
chown "$uid:$gid" "$XDG_CACHE_HOME"
mkdir -p "$XDG_STATE_HOME"
chmod 700 "$XDG_STATE_HOME"
chown "$uid:$gid" "$XDG_STATE_HOME"
}
_sxmo_grab_session
+23
View File
@@ -0,0 +1,23 @@
! Space to setup configversion
! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
dmenu.background: #1c1c1c
dmenu.foreground: #e0e0e0
dmenu.selbackground: #005577
dmenu.selforeground: #ffffff
dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
dwm.normbgcolor: #323232
dwm.normbordercolor: #444444
dwm.normfgcolor: #dddddd
dwm.selbgcolor: #005577
dwm.selbordercolor: #005577
dwm.selfgcolor: #ffffff
st.font: Fira Code:pixelsize=13:antialias=true:autohint=true
st.background: #1c1c1c
st.foreground: #e5e5e5
st.cursorColor: #cccccc
svkbd.font: Fira Code:pixelsize=12
@@ -1,40 +0,0 @@
# Space to setup configversion
# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
font=monospace:size=13
dpi-aware=no
pad=2x2
[colors-dark]
# alpha=1.0
foreground=eaeaea
background=000000
regular0=000000 # black
regular1=d54e53 # red
regular2=b9ca4a # green
regular3=e6c547 # yellow
regular4=7aa6da # blue
regular5=c397d8 # magenta
regular6=70c0ba # cyan
regular7=eaeaea # white
bright0=666666 # bright black
bright1=ff3334 # bright red
bright2=9ec400 # bright green
bright3=e7c547 # bright yellow
bright4=7aa6da # bright blue
bright5=b77ee0 # bright magenta
bright6=54ced6 # bright cyan
bright7=ffffff # bright white
[scrollback]
lines=5000
[key-bindings]
scrollback-up-page=Shift+Page_Up
scrollback-down-page=Shift+Page_Down
scrollback-up-half-page=Page_Up
scrollback-down-half-page=Page_Down
scrollback-up-line=Shift+Up
scrollback-down-line=Shift+Down
scrollback-home=Shift+Home
scrollback-end=Shift+End
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
out_to_x = false,
out_to_wayland = true,
output_backend = 'x11',
out_to_x = true,
out_to_wayland = false,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
double_buffer = true,
alignment = 'top_middle',
gap_y = 12,
own_window_argb_value = 0,
own_window_type = 'desktop',
gap_x = 0,
gap_y = 34,
default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
font = 'Sxmo:size=13',
font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
exec 0<<EOF
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
if [ -r "$STATE_FILE" ]; then
read -r CURRENT_STATE < "$STATE_FILE" || CURRENT_STATE=""
else
CURRENT_STATE="$(sxmo_state.sh get)"
fi
if [ "$CURRENT_STATE" != "unlock" ] && sxmo_state.sh is_locked; then
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
if [ -n "$WAYLAND_DISPLAY" ]; then
wlopm --on "*" >/dev/null 2>&1 || sxmo_wm.sh display on
else
sxmo_wm.sh display on
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
else
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
fi
sxmo_state.sh set unlock &
exit 0
;;
"voldown_one"|"volup_one")
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
sxmo_debug "STATE: $(sxmo_state.sh get) ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
if sxmo_state.sh is_locked; then
case "$WMNAME" in # Handle programs
*"epy"*|*"epr"*)
case "$ACTION" in
"voldown_one")
sxmo_type.sh l
exit 0
;;
"volup_one")
sxmo_type.sh h
read -r WMCLASS
read -r WMNAME
case "$WMNAME" in
*"epy"*|*"epr"*)
if [ "$ACTION" = "voldown_one" ]; then
sxmo_type.sh l
else
sxmo_type.sh h
fi
exit 0
;;
esac
;;
esac
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_state.sh set unlock
sxmo_wm.sh display on
;;
"voldown_one")
sxmo_audio.sh vol down 5
exit
if [ "$ACTION" = "voldown_one" ]; then
sxmo_audio.sh vol down 5
else
sxmo_audio.sh vol up 5
fi
exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
"volup_one")
sxmo_audio.sh vol up 5
exit
;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
case "$ACTION" in
"menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
WMCLASS=""
WMNAME=""
;;
*)
if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
{
read -r WMCLASS || WMCLASS=""
read -r WMNAME || WMNAME=""
} < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
else
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
fi
;;
esac
if [ -n "$SXMO_DEBUG" ]; then
sxmo_debug "STATE: $CURRENT_STATE ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
fi
#special context-sensitive handling
case "$WMCLASS" in
*"mpv"*)
@@ -367,7 +401,7 @@ case "$ACTION" in
exit 0
;;
"enter_one")
if pidof -q sxmo_RepeatRing.sh; then
if pidof -s sxmo_RepeatRing.sh >/dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
+89
View File
@@ -0,0 +1,89 @@
#!/bin/sh
# configversion: e7cdaa3a889d251bed8a89ce8c622995
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Please modify this file to your liking
# Important Instructions:
# All processes you launch from this script must
# be non-blocking: launch them in the background (using &)
# or ensure they return quickly. Only after this script
# finishes will the window manager be loaded
# You will sometime get SMS or calls from not
# country code prefixed phone numbers. To make
# it easy to fixup configure the default countryu.
#export DEFAULT_COUNTRY=FR
### Configuration Parameters ###
# Note that this is just a subset of all available
# parameters, see the sxmo documentation for more.
# Use firefox as default browser if installed
command -v firefox >/dev/null && export BROWSER=firefox
# Prepopulate Subreddits menu with custom subreddits
#export SXMO_SUBREDDITS="postmarketos pinephoneOfficial pinephone unixporn"
# Change the default terminal command
export TERMCMD="sxmo_terminal.sh"
# Change the used terminal command
# export SXMO_TERMINAL="st"
# When scrolling past the beginning or end of a menu, wrap it around:
#export DMENU_WRAP_AROUND=1
# Enable audio feedback on keypress
#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)"
# Or, enable vibration feedback on keypress
#export KEYBOARD_ARGS="-o | clickclack -V"
# Set the scale factor in sway
# export SXMO_SWAY_SCALE=2
# To load specific part of configuration depending on the running environment
case "$SXMO_WM" in
sway)
;;
dwm)
;;
esac
#Set RINGTONE to audio file to play for incoming call
export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)"
#Set TEXTSOUND to audio file to play when received text message
export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)"
#Set RINGTIME to number of seconds the phone will ring
export SXMO_RINGTIME=20
#Set RINGNUMBER to number of times phone will ring or repeat ringtone
#(whichever of SXMO_RINGTIME or SXMO_RINGNUMBER runs less will limit how long phone rings)
export SXMO_RINGNUMBER=10
#Set to the default text for a new text message.
export SXMO_DEFAULT_DRAFT="Enter new message here."
export PATH="$HOME/.local/bin:$PATH"
export SXMO_WM="dwm"
export SXMO_MENU="dmenu"
export SXMO_TERMINAL="st"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
export SXMO_DISABLE_LEDS=1
export SXMO_NO_VIRTUAL_KEYBOARD=1
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
-296
View File
@@ -1,296 +0,0 @@
# Default config for sway
# configversion: 076611fe8cc699bcaa01092a8e4481c0
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term sxmo_terminal.sh
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu bemenu-run
font "Sxmo 13"
xwayland disable
output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
default_orientation vertical
exec_always sxmo_swayinitconf.sh
exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
mode "menu" {
bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym XF86AudioRaiseVolume exec wtype -k Up
bindsym XF86AudioLowerVolume exec wtype -k Down
bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
}
# Mode specifically for use with Nokia N900 hardware keyboard
mode "N900" {
# follow the standard sxmo keybinds as far as possible
bindsym t exec $term; mode "default"
bindsym q mode "default"
bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
bindsym p exec sxmo_appmenu.sh; mode "default"
bindsym d exec $menu; mode "default"
bindsym Shift+q kill; mode "default"
bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
bindsym Shift+c reload; mode "default"
bindsym f fullscreen; mode "default"
bindsym Shift+space floating toggle; mode "default"
bindsym a focus parent; mode "default"
}
### Key bindings
#
# Basics:
#
input * xkb_options compose:ralt
# Nokia N900 hardware keyboard
input "1:1:TWL4030_Keypad" {
xkb_model "nokiarx51"
xkb_layout "us"
# ralt has special meaning on N900 keyboard so do not use as
# compose key
xkb_options compose:rwin
}
# Start a terminal
bindsym $mod+Return exec $term
# Launch appmenu
bindsym $mod+p exec sxmo_appmenu.sh
bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
# Wm menu switcher
bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Move the focused workspace to output
bindsym $mod+Shift+Ctrl+$left move workspace output left
bindsym $mod+Shift+Ctrl+$down move workspace output down
bindsym $mod+Shift+Ctrl+$up move workspace output up
bindsym $mod+Shift+Ctrl+$right move workspace output right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
# Manual locker
bindsym $mod+g exec sxmo_state.sh set locker
# Shutdown
bindsym $mod+t exec sxmo_appmenu.sh power
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 30px
bindsym $down resize grow height 30px
bindsym $up resize shrink height 30px
bindsym $right resize grow width 30px
# Ditto, with arrow keys
bindsym Left resize shrink width 30px
bindsym Down resize grow height 30px
bindsym Up resize shrink height 30px
bindsym Right resize grow width 30px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
height 24
font "Sxmo 13"
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command sxmo_status_watch.sh -o pango
pango_markup enabled
colors {
statusline #ffffff
background #323232
inactive_workspace #323232 #323232 #ffffff
font "Sxmo 13"
}
}
for_window [app_id="pinentry-.*"] floating true
for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
for_window [title="megapixels"] inhibit_idle open
for_window [title="ep[yr].*"] inhibit_idle visible
default_border pixel 2
titlebar_border_thickness 2
hide_edge_borders smart
# Need playerctl installed and running
bindsym --locked XF86AudioPlay exec playerctl play-pause
bindsym --locked XF86AudioPause exec playerctl play-pause
bindsym --locked XF86AudioStop exec playerctl stop
bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioPrev exec playerctl previous
bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
# Nokia N900-specific key bindings:
# 1. Bind lock key (XF86ScreenSaver)
# Use keycode due to https://github.com/swaywm/sway/issues/8438
bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
# 2. Workaround the lack of a free ModX key on hardware keyboard
bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
bindsym Print exec sxmo_screenshot.sh
bindsym button2 kill
bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
# Nokia 8110 4G hardware keypad bindings (User:Ybon)
bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
include /etc/sway/config.d/*
exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
exec sxmo_hook_start.sh
# vim: ft=swayconfig
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# configversion: 36730424afa6d6bf9e9fb6d111c35504
dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
# Run actions on start
sxmo_hook_start.sh &
+16
View File
@@ -0,0 +1,16 @@
export PATH="$HOME/.local/bin:$PATH"
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
export SXMO_DISABLE_LEDS=1
export SXMO_NO_VIRTUAL_KEYBOARD=1
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
@@ -1 +1,2 @@
SUBSYSTEM=="leds", ACTION=="add", RUN+="/bin/chgrp video /sys/class/leds/%k/brightness", RUN+="/bin/chmod 0664 /sys/class/leds/%k/brightness"
SUBSYSTEM=="backlight", ACTION=="add", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power", RUN+="/bin/chmod 0664 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"
+23
View File
@@ -0,0 +1,23 @@
! Space to setup configversion
! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
dmenu.background: #1c1c1c
dmenu.foreground: #e0e0e0
dmenu.selbackground: #005577
dmenu.selforeground: #ffffff
dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
dwm.normbgcolor: #323232
dwm.normbordercolor: #444444
dwm.normfgcolor: #dddddd
dwm.selbgcolor: #005577
dwm.selbordercolor: #005577
dwm.selfgcolor: #ffffff
st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true
st.background: #1c1c1c
st.foreground: #e5e5e5
st.cursorColor: #cccccc
svkbd.font: Fira Code:pixelsize=12
@@ -9,7 +9,7 @@
frame_width = 2
frame_color = "#005577"
idle_threshold = 120
font = Monospace 12
font = Fira Code 9.5
markup = full
max_icon_size = 24
dmenu = sxmo_dmenu.sh -p dunst:
@@ -1,8 +1,8 @@
Vertical Candidate List=False
WheelForPaging=True
Font="Sans Bold 13"
MenuFont="Sans 13"
TrayFont="Sans Bold 13"
Font="Fira Code 9.5"
MenuFont="Fira Code 9.5"
TrayFont="Fira Code 9.5"
PreferTextIcon=True
ShowLayoutNameInIcon=True
UseInputMethodLanguageToDisplayText=True
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!-- configversion: c90188e736e042ebe71879799645b0c4 -->
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Sxmo</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
</fontconfig>
@@ -1,40 +0,0 @@
# Space to setup configversion
# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
font=monospace:size=13
dpi-aware=no
pad=2x2
[colors-dark]
# alpha=1.0
foreground=eaeaea
background=000000
regular0=000000 # black
regular1=d54e53 # red
regular2=b9ca4a # green
regular3=e6c547 # yellow
regular4=7aa6da # blue
regular5=c397d8 # magenta
regular6=70c0ba # cyan
regular7=eaeaea # white
bright0=666666 # bright black
bright1=ff3334 # bright red
bright2=9ec400 # bright green
bright3=e7c547 # bright yellow
bright4=7aa6da # bright blue
bright5=b77ee0 # bright magenta
bright6=54ced6 # bright cyan
bright7=ffffff # bright white
[scrollback]
lines=5000
[key-bindings]
scrollback-up-page=Shift+Page_Up
scrollback-down-page=Shift+Page_Down
scrollback-up-half-page=Page_Up
scrollback-down-half-page=Page_Down
scrollback-up-line=Shift+Up
scrollback-down-line=Shift+Down
scrollback-home=Shift+Home
scrollback-end=Shift+End
@@ -1,3 +1,3 @@
[Settings]
gtk-application-prefer-dark-theme=1
gtk-font-name=Sans 13
gtk-font-name=Fira Code 10
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
out_to_x = false,
out_to_wayland = true,
output_backend = 'x11',
out_to_x = true,
out_to_wayland = false,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
double_buffer = true,
alignment = 'top_middle',
gap_y = 12,
own_window_argb_value = 0,
own_window_type = 'desktop',
gap_x = 0,
gap_y = 34,
default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
font = 'Sxmo:size=13',
font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
exec 0<<EOF
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
if [ -r "$STATE_FILE" ]; then
read -r CURRENT_STATE < "$STATE_FILE" || CURRENT_STATE=""
else
CURRENT_STATE="$(sxmo_state.sh get)"
fi
if [ "$CURRENT_STATE" != "unlock" ] && sxmo_state.sh is_locked; then
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
if [ -n "$WAYLAND_DISPLAY" ]; then
wlopm --on "*" >/dev/null 2>&1 || sxmo_wm.sh display on
else
sxmo_wm.sh display on
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
else
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
fi
sxmo_state.sh set unlock &
exit 0
;;
"voldown_one"|"volup_one")
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
sxmo_debug "STATE: $(sxmo_state.sh get) ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
if sxmo_state.sh is_locked; then
case "$WMNAME" in # Handle programs
*"epy"*|*"epr"*)
case "$ACTION" in
"voldown_one")
sxmo_type.sh l
exit 0
;;
"volup_one")
sxmo_type.sh h
read -r WMCLASS
read -r WMNAME
case "$WMNAME" in
*"epy"*|*"epr"*)
if [ "$ACTION" = "voldown_one" ]; then
sxmo_type.sh l
else
sxmo_type.sh h
fi
exit 0
;;
esac
;;
esac
case "$ACTION" in
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_state.sh set unlock
sxmo_wm.sh display on
;;
"voldown_one")
sxmo_audio.sh vol down 5
exit
if [ "$ACTION" = "voldown_one" ]; then
sxmo_audio.sh vol down 5
else
sxmo_audio.sh vol up 5
fi
exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
"volup_one")
sxmo_audio.sh vol up 5
exit
;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
case "$ACTION" in
"menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
WMCLASS=""
WMNAME=""
;;
*)
if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
{
read -r WMCLASS || WMCLASS=""
read -r WMNAME || WMNAME=""
} < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
else
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
fi
;;
esac
if [ -n "$SXMO_DEBUG" ]; then
sxmo_debug "STATE: $CURRENT_STATE ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
fi
#special context-sensitive handling
case "$WMCLASS" in
*"mpv"*)
@@ -367,7 +401,7 @@ case "$ACTION" in
exit 0
;;
"enter_one")
if pidof -q sxmo_RepeatRing.sh; then
if pidof -s sxmo_RepeatRing.sh >/dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
@@ -10,13 +10,18 @@
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
xdg-user-dirs-update
[ -d "$HOME/Pictures" ] || xdg-user-dirs-update &
# Ensure fontconfig cache is valid without forcing a full rescan on every boot
if command -v fc-cache > /dev/null && [ -z "$(ls -A /var/cache/fontconfig 2>/dev/null)" ]; then
fc-cache >/dev/null 2>&1 &
fi
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
sleep 0.5
sleep 0.05
done
# Not dangerous if "locker" isn't an available state
@@ -54,48 +59,14 @@ superctl start dunst
# start adaptive brightness at boot
# superctl start sxmo_adaptivebrightness
# load some other little things here too.
case "$SXMO_WM" in
river)
superctl start sxmo_wob
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
superctl start sxmo_riverbar
;;
sway)
superctl start sxmo_wob
superctl start sxmo_menumode_toggler
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
;;
dwm|i3)
superctl start sxmo_xob
# Auto hide cursor with touchscreen, Show it with a mouse
if command -v "unclutter-xfixes" > /dev/null; then
set -- unclutter-xfixes
else
set -- unclutter
fi
superctl start "$1"
superctl start autocutsel
superctl start autocutsel-primary
superctl start sxmo-x11-status
[ "$(command -v bonsaid)" ] && superctl start bonsaid
[ "$(command -v fcitx5)" ] && superctl start fcitx5
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Set onboard to auto-hide in config first
if [ "$KEYBOARD" = "onboard" ]; then
onboard "$KEYBOARD_ARGS"
fi
case "$SXMO_WM" in
i3)
xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
;;
esac
;;
esac
# load X11 dwm services
[ "$(command -v sxmo_xob)" ] && superctl start sxmo_xob
pidof -s sxmo_status_xsetroot.sh >/dev/null 2>&1 || superctl start sxmo-x11-status
[ "$(command -v bonsaid)" ] && superctl start bonsaid
if ! pidof -s fcitx5 >/dev/null 2>&1 && [ "$(command -v fcitx5)" ]; then
superctl start fcitx5
fi
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
@@ -106,8 +77,8 @@ fi
# To setup initial unlock state
sxmo_state.sh set unlock
# Turn on lisgd
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
# Turn on lisgd only on touch devices
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
@@ -120,11 +91,8 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
# Start the desktop wallpaper
superctl start sxmo_bg
# Start the desktop widget (e.g. clock)
superctl start sxmo_conky
pidof -s conky >/dev/null 2>&1 || superctl start sxmo_conky
# Monitor the battery
superctl start sxmo_battery_monitor
@@ -135,25 +103,8 @@ superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
# Play a funky startup tune if you want (disabled by default)
#mpv --quiet --no-video ~/welcome.ogg &
# mmsd and vvmd
if [ -z "$SXMO_NO_MODEM" ]; then
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
superctl start mmsd-tng
fi
if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
superctl start vvmd
fi
fi
# add some warnings if things are not setup correctly
if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
sxmo_notify_user.sh --urgency=critical \
"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
fi
sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
# Pre-warm app and script menu caches in background
(
sxmo_hook_apps.sh >/dev/null 2>&1 || true
sxmo_hook_scripts.sh >/dev/null 2>&1 || true
) &
+12 -1
View File
@@ -70,9 +70,20 @@ export SXMO_RINGNUMBER=10
#Set to the default text for a new text message.
export SXMO_DEFAULT_DRAFT="Enter new message here."
export PATH="$HOME/.local/bin:$PATH"
export SXMO_WM="dwm"
export SXMO_MENU="dmenu"
export SXMO_TERMINAL="st"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
export SXMO_DISABLE_LEDS=1
export SXMO_NO_VIRTUAL_KEYBOARD=1
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SXMO_MENU=wofi
export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
-296
View File
@@ -1,296 +0,0 @@
# Default config for sway
# configversion: 076611fe8cc699bcaa01092a8e4481c0
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term sxmo_terminal.sh
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu bemenu-run
font "Sxmo 13"
xwayland disable
output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
default_orientation vertical
exec_always sxmo_swayinitconf.sh
exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
mode "menu" {
bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym XF86AudioRaiseVolume exec wtype -k Up
bindsym XF86AudioLowerVolume exec wtype -k Down
bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
}
# Mode specifically for use with Nokia N900 hardware keyboard
mode "N900" {
# follow the standard sxmo keybinds as far as possible
bindsym t exec $term; mode "default"
bindsym q mode "default"
bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
bindsym p exec sxmo_appmenu.sh; mode "default"
bindsym d exec $menu; mode "default"
bindsym Shift+q kill; mode "default"
bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
bindsym Shift+c reload; mode "default"
bindsym f fullscreen; mode "default"
bindsym Shift+space floating toggle; mode "default"
bindsym a focus parent; mode "default"
}
### Key bindings
#
# Basics:
#
input * xkb_options compose:ralt
# Nokia N900 hardware keyboard
input "1:1:TWL4030_Keypad" {
xkb_model "nokiarx51"
xkb_layout "us"
# ralt has special meaning on N900 keyboard so do not use as
# compose key
xkb_options compose:rwin
}
# Start a terminal
bindsym $mod+Return exec $term
# Launch appmenu
bindsym $mod+p exec sxmo_appmenu.sh
bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
# Wm menu switcher
bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Move the focused workspace to output
bindsym $mod+Shift+Ctrl+$left move workspace output left
bindsym $mod+Shift+Ctrl+$down move workspace output down
bindsym $mod+Shift+Ctrl+$up move workspace output up
bindsym $mod+Shift+Ctrl+$right move workspace output right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
# Manual locker
bindsym $mod+g exec sxmo_state.sh set locker
# Shutdown
bindsym $mod+t exec sxmo_appmenu.sh power
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 30px
bindsym $down resize grow height 30px
bindsym $up resize shrink height 30px
bindsym $right resize grow width 30px
# Ditto, with arrow keys
bindsym Left resize shrink width 30px
bindsym Down resize grow height 30px
bindsym Up resize shrink height 30px
bindsym Right resize grow width 30px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
height 24
font "Sxmo 13"
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command sxmo_status_watch.sh -o pango
pango_markup enabled
colors {
statusline #ffffff
background #323232
inactive_workspace #323232 #323232 #ffffff
font "Sxmo 13"
}
}
for_window [app_id="pinentry-.*"] floating true
for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
for_window [title="megapixels"] inhibit_idle open
for_window [title="ep[yr].*"] inhibit_idle visible
default_border pixel 2
titlebar_border_thickness 2
hide_edge_borders smart
# Need playerctl installed and running
bindsym --locked XF86AudioPlay exec playerctl play-pause
bindsym --locked XF86AudioPause exec playerctl play-pause
bindsym --locked XF86AudioStop exec playerctl stop
bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioPrev exec playerctl previous
bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
# Nokia N900-specific key bindings:
# 1. Bind lock key (XF86ScreenSaver)
# Use keycode due to https://github.com/swaywm/sway/issues/8438
bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
# 2. Workaround the lack of a free ModX key on hardware keyboard
bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
bindsym Print exec sxmo_screenshot.sh
bindsym button2 kill
bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
# Nokia 8110 4G hardware keypad bindings (User:Ybon)
bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
include /etc/sway/config.d/*
exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
exec sxmo_hook_start.sh
# vim: ft=swayconfig
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# configversion: 36730424afa6d6bf9e9fb6d111c35504
dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
# Run actions on start
sxmo_hook_start.sh &
@@ -1,12 +0,0 @@
# Space to setup configversion
# configversion: eb37989d3b93bf46e0df32db4ffd833e
matching=multi-contains
width=240
height=296
halign=fill
orientation=vertical
content_halign=fill
insensitive=true
prompt=
show=dmenu
no_actions=true
@@ -1,51 +0,0 @@
/* Space to setup configversion */
/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
* {
font-family: monospace;
font-size: 15px;
}
window {
margin: 0px;
border: 2px solid #005577;
background-color: #1c1c1c;
}
#input {
margin: 0px;
padding: 4px 6px;
border-radius: 0px;
border: 1px solid #005577;
background-color: #383838;
color: #ffffff;
font-size: 15px;
font-weight: bold;
}
#inner-box {
margin: 0px;
}
#outer-box {
margin: 1px;
}
#scroll {
margin: 0px;
color: #ffdd00;
}
#text {
margin: 1px 4px;
color: #ffffff;
}
#entry {
padding: 3px 2px;
margin: 0px;
}
#entry:selected {
background-color: #005577;
font-weight: bold;
}
+16
View File
@@ -0,0 +1,16 @@
export PATH="$HOME/.local/bin:$PATH"
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
export SXMO_DISABLE_LEDS=1
export SXMO_NO_VIRTUAL_KEYBOARD=1
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
+1
View File
@@ -0,0 +1 @@
Xorg
BIN
View File
Binary file not shown.
+12 -4
View File
@@ -75,7 +75,7 @@ get_pictures_dir() {
}
notify_msg() {
if command -v sxmo_notify_user.sh >/dev/null 2>&1 && [ -n "${WAYLAND_DISPLAY:-}" ]; then
if command -v sxmo_notify_user.sh >/dev/null 2>&1 && [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]; then
sxmo_notify_user.sh -t 2000 "$1" >/dev/null 2>&1 || true
fi
}
@@ -135,8 +135,12 @@ take_photo() {
printf "%s\n" "$target_path"
notify_msg "Saved $(basename "$target_path")"
if [ "$VIEW_AFTER" -eq 1 ] && [ -n "${WAYLAND_DISPLAY:-}" ] && command -v imv >/dev/null 2>&1; then
imv "$target_path" >/dev/null 2>&1 &
if [ "$VIEW_AFTER" -eq 1 ] && [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]; then
if command -v feh >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
feh --scale-down "$target_path" >/dev/null 2>&1 &
elif command -v imv >/dev/null 2>&1; then
imv "$target_path" >/dev/null 2>&1 &
fi
fi
return 0
}
@@ -169,7 +173,11 @@ run_menu() {
*"View photos"*)
pic_dir="$(get_pictures_dir)"
if ls "$pic_dir"/*.jpg "$pic_dir"/*.png >/dev/null 2>&1; then
imv "$pic_dir" >/dev/null 2>&1 &
if command -v feh >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
feh --scale-down "$pic_dir" >/dev/null 2>&1 &
else
imv "$pic_dir" >/dev/null 2>&1 &
fi
else
notify_msg "No photos in $pic_dir"
fi
BIN
View File
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
cache="$cachedir/dmenu_run"
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
IFS=:
if stest -dqr -n "$cache" $PATH; then
stest -flx $PATH | sort -u | tee "$cache"
else
cat "$cache"
fi
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+322
View File
@@ -0,0 +1,322 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
unalias dmenu 2>/dev/null || true
unalias bemenu 2>/dev/null || true
confirm() {
PICKED="$(printf "Yes\nNo\n" | run_dmenu -p "Confirm $1")"
if [ "$PICKED" = "Yes" ]; then
return 0
else
return 1
fi
}
run_dmenu() {
if [ "${SXMO_WM:-dwm}" = "dwm" ] && command -v dmenu >/dev/null 2>&1; then
dmenu -c -l "${SXMO_DMENU_PORTRAIT_LINES:-9}" "$@"
else
sxmo_dmenu.sh "$@"
fi
}
supertoggle_daemon() {
if superctl status "$1" | grep -q started; then
superctl stop "$1"
sxmo_notify_user.sh "$1 Stopped"
else
superctl start "$1"
sxmo_notify_user.sh "$1 Started"
fi
}
toggle_daemon() {
name="$1"
shift
if sxmo_jobs.sh running "$1" -q; then
sxmo_jobs.sh stop "$@"
notify-send "$name Stopped"
else
sxmo_jobs.sh start "$@" &
notify-send "$name Started"
fi
}
sxmo_type() {
sxmo_type.sh -s 200 "$@"
}
get_focused_window() {
if [ -r "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo.focusedwin" ]; then
{
read -r WMCLASS || WMCLASS=""
read -r WMNAME || WMNAME=""
} < "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo.focusedwin"
return
fi
exec 0<<EOF
$(sxmo_wm.sh focusedwindow -r)
EOF
read -r WMCLASS
read -r WMNAME
}
has_tracked_calls() {
[ -d "$XDG_RUNTIME_DIR/sxmo_calls" ] || return 1
for f in "$XDG_RUNTIME_DIR/sxmo_calls"/*; do
[ -e "$f" ] && return 0
done
return 1
}
call_entries() {
has_tracked_calls || return 0
shown_incall_menu=
sxmo_modemcall.sh list_active_calls | while read -r line; do
case "$line" in
*"(ringing-in)")
CALLID="${line%% *}"
CALLID="${CALLID##*/}"
NUMBER="$(sxmo_modemcall.sh vid_to_number "$CALLID")"
CONTACT="$(sxmo_contacts.sh --name "$NUMBER")"
printf "%s Incoming call %s ^ 0 ^ sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu %s\n" \
"$icon_phn" "$CONTACT" "$CALLID"
;;
*)
[ -n "$shown_incall_menu" ] && continue
shown_incall_menu=1
printf "%s Incall Menu ^ 0 ^ sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu\n" \
"$icon_phn"
;;
esac
done
}
count_notifications() {
n=0
if [ -d "$SXMO_NOTIFDIR" ]; then
for f in "$SXMO_NOTIFDIR"/*; do
[ -f "$f" ] && n=$((n + 1))
done
fi
printf "%s" "$n"
}
bt_is_unblocked_fast() {
for rfk in /sys/class/rfkill/rfkill*; do
[ -r "$rfk/type" ] || continue
read -r rtype < "$rfk/type" 2>/dev/null || continue
if [ "$rtype" = "bluetooth" ]; then
read -r soft < "$rfk/soft" 2>/dev/null || soft=0
read -r hard < "$rfk/hard" 2>/dev/null || hard=0
[ "$soft" = "0" ] && [ "$hard" = "0" ] && return 0
return 1
fi
done
return 1
}
fast_sys_choices() {
WINNAME="Sys"
_bt_line=""
if bt_is_unblocked_fast; then
_bt_line="$icon_bth Bluetooth^1^sxmo_bluetoothmenu.sh
"
fi
_flash_line=""
_bl=""
if [ -r /sys/class/leds/white:torch/brightness ]; then
read -r _bl < /sys/class/leds/white:torch/brightness 2>/dev/null || _bl=""
elif [ -r /sys/class/leds/white:flash/brightness ]; then
read -r _bl < /sys/class/leds/white:flash/brightness 2>/dev/null || _bl=""
fi
if [ -n "$_bl" ]; then
if [ "$_bl" -gt 0 ] 2>/dev/null; then
_flash_line="$icon_fll Flashlight $icon_ton^1^sxmo_flashtoggle.sh
"
else
_flash_line="$icon_fll Flashlight $icon_tof^1^sxmo_flashtoggle.sh
"
fi
fi
CHOICES="$icon_trm St^0^st -e ${SHELL:-/bin/sh}
$icon_grd Apps^0^sxmo_appmenu.sh applications
$icon_grd Scripts^0^sxmo_appmenu.sh scripts
$icon_dir Files^0^sxmo_files.sh
$icon_phn Dialer^0^sxmo_modemdial.sh
$icon_msg Texts^0^sxmo_modemtext.sh
$icon_usr Contacts^0^sxmo_contactmenu.sh
${_bt_line}$icon_cam Camera^0^bananarchy-photo --menu
${_flash_line}$icon_net Networks^0^sxmo_networks.sh
$icon_mus Audio^0^sxmo_audio.sh
$icon_phn Modem^0^sxmo_appmenu.sh modem
$icon_win Windows^0^sxmo_wmmenu.sh
$icon_cfg Config^0^sxmo_appmenu.sh config
$icon_pwr Power^0^sxmo_appmenu.sh power"
}
getprogchoices() {
case "$WMCLASS" in
""|sys)
fast_sys_choices
;;
applications)
WINNAME="Apps"
if [ -s "${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache" ]; then
CHOICES="$(cat "${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache")"
else
CHOICES="$(sxmo_hook_apps.sh)"
fi
;;
scripts)
WINNAME="Scripts"
if [ -s "${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache" ]; then
CHOICES="$(cat "${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache")"
else
CHOICES="$(sxmo_hook_scripts.sh)"
fi
;;
power)
WINNAME="Power"
CHOICES="$icon_lck Lock^0^sxmo_state.sh set lock
$icon_lck Lock (Screen off)^0^sxmo_state.sh set screenoff
$icon_out Logout^0^confirm Logout && sxmo_power.sh logout
$icon_rld Reboot^0^confirm Reboot && sxmo_power.sh reboot
$icon_pwr Poweroff^0^confirm Poweroff && sxmo_power.sh poweroff"
;;
modem)
WINNAME="Modem"
CHOICES="$icon_plk Modem PIN^0^sxmo_unlocksim.sh
$icon_inf Modem Info^0^sxmo_modeminfo.sh
$icon_phl Modem Log^0^sxmo_modemlog.sh"
;;
config)
WINNAME="Config"
_bt_icon="$icon_tof"
bt_is_unblocked_fast && _bt_icon="$icon_ton"
_susp_icon="$icon_ton"
[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend" ] && _susp_icon="$icon_tof"
_idle_icon="$icon_ton"
[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle" ] && _idle_icon="$icon_tof"
CHOICES="$icon_aru Brightness^1^sxmo_brightness.sh up
$icon_ard Brightness^1^sxmo_brightness.sh down
$icon_cfg Toggle Bar^0^sxmo_wm.sh togglebar
$icon_bth Bluetooth $_bt_icon^1^doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth
$icon_clk Change Timezone^1^sxmo_timezonechange.sh
$icon_zzz Auto-suspend $_susp_icon^1^(rm ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend 2>/dev/null || touch ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend)
$icon_zzz Auto-screen-off $_idle_icon^1^(rm ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle 2>/dev/null || touch ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle) && sxmo_state.sh set unlock
$icon_trm Hooks^0^sxmo_hookmenu.sh
$icon_cfg Suspend Blockers^0^sxmo_terminal.sh sxmo_debug_suspend.sh
$icon_inf Log^0^sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
$icon_inf Version^0^sxmo_terminal.sh sxmo_version.sh --block"
;;
*)
RES="$(sxmo_hook_contextmenu.sh "$WMCLASS" "$WMNAME")"
if [ -n "$RES" ]; then
nl='
'
WINNAME="${RES%%"$nl"*}"
CHOICES="${RES#*"$nl"}"
fi
;;
esac
if [ "$WINNAME" = "Sys" ]; then
NNOTIFICATIONS="$(count_notifications)"
if [ "$NNOTIFICATIONS" -gt 0 ]; then
CHOICES="$icon_bel Notifications ($NNOTIFICATIONS)^0^sxmo_notifs.sh menu
$CHOICES"
fi
fi
if has_tracked_calls; then
CHOICES="$(call_entries)
$CHOICES"
fi
case "$WINNAME" in
*Sys*) ;;
*)
CHOICES="$CHOICES
$icon_mnu System Menu^0^sxmo_appmenu.sh sys"
;;
esac
CHOICES="$CHOICES
$icon_cls Close Menu^0^quit"
case "$WMCLASS" in
""|sys|applications|scripts|power|modem|config)
;;
*)
CHOICES="$(printf "%s\n" "$CHOICES" | awk 'NF {$1=$1; print}')"
;;
esac
}
quit() {
exit 0
}
mainloop() {
getprogchoices
PICKED="$(
printf "%s\n" "$CHOICES" |
cut -d'^' -f1 |
run_dmenu -i -p "$WINNAME"
)" || quit
CHOICE="$(printf "%s\n" "$CHOICES" | awk -F '^' -v picked="$PICKED" \
'$1 == picked || $1 == picked " " {print $2 "^" $3; exit}'
)"
LOOP="${CHOICE%%^*}"
CMD="${CHOICE#*^}"
CMD="${CMD#"${CMD%%[![:space:]]*}"}"
if [ -z "$CHOICE" ] || [ -z "$CMD" ]; then
printf "%s\n" "sxmo_appmenu: Fallback: unknown choice <$PICKED> to contextmenu_fallback hook">&2
sxmo_hook_contextmenu_fallback.sh "$WINNAME" "$PICKED"
quit
fi
case "$CMD" in
"sxmo_appmenu.sh "*)
set -- ${CMD#sxmo_appmenu.sh }
WMCLASS="$1"
WMNAME="$2"
return 0
;;
esac
eval "$CMD"
case "$LOOP" in
*1*) ;;
*) quit ;;
esac
}
if [ -z "$SHELLSPEC_PATH" ]; then
if [ $# -gt 0 ] ; then
WMCLASS="$1"
WMNAME="$2"
else
get_focused_window
fi
while true; do
mainloop
done
fi
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
upower -m | while read -r line; do
# swallow first line ("Monitoring activity from the power daemon...")
if [ -z "$started" ]; then
started=1
continue
fi
line="${line#* }"
event="${line%%:*}"
object="${line#*:}"
object="${object#"${object%%[![:space:]]*}"}"
if [ -z "$object" ]; then
continue
fi
sxmo_hook_battery.sh "$object" "$event"
done
@@ -1,9 +1,14 @@
#!/bin/sh
export SXMO_WM=sway
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
export SXMO_SWAY_SCALE=1
export GSK_RENDERER=cairo
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
# Nokia 8110 4G has a physical keypad and no touchscreen
# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
export SXMO_MENU=wofi
export SXMO_WOFI_LANDSCAPE_WIDTH=320
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
export SXMO_BEMENU_PORTRAIT_LINES=10
export SXMO_BEMENU_LANDSCAPE_LINES=6
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
@@ -1,9 +1,14 @@
#!/bin/sh
export SXMO_WM=sway
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
export SXMO_SWAY_SCALE=1
export GSK_RENDERER=cairo
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
# Nokia 8110 4G has a physical keypad and no touchscreen
# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
export SXMO_MENU=wofi
export SXMO_WOFI_LANDSCAPE_WIDTH=320
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
export SXMO_BEMENU_PORTRAIT_LINES=10
export SXMO_BEMENU_LANDSCAPE_LINES=6
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
@@ -1,9 +1,14 @@
#!/bin/sh
export SXMO_WM=sway
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
export SXMO_SWAY_SCALE=1
export GSK_RENDERER=cairo
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
# Nokia 8110 4G has a physical keypad and no touchscreen
# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
export SXMO_MENU=wofi
export SXMO_WOFI_LANDSCAPE_WIDTH=320
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
export SXMO_BEMENU_PORTRAIT_LINES=10
export SXMO_BEMENU_LANDSCAPE_LINES=6
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
@@ -1,9 +1,14 @@
#!/bin/sh
export SXMO_WM=sway
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
export SXMO_SWAY_SCALE=1
export GSK_RENDERER=cairo
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
# Nokia 8110 4G has a physical keypad and no touchscreen
# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
export SXMO_MENU=wofi
export SXMO_WOFI_LANDSCAPE_WIDTH=320
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
export SXMO_BEMENU_PORTRAIT_LINES=10
export SXMO_BEMENU_LANDSCAPE_LINES=6
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
@@ -1,9 +1,14 @@
#!/bin/sh
export SXMO_WM=sway
export SXMO_WM=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
export SXMO_SWAY_SCALE=1
export GSK_RENDERER=cairo
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
# Nokia 8110 4G has a physical keypad and no touchscreen
# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
export SXMO_MENU=wofi
export SXMO_WOFI_LANDSCAPE_WIDTH=320
export SXMO_WOFI_LANDSCAPE_HEIGHT=200
export SXMO_BEMENU_PORTRAIT_LINES=10
export SXMO_BEMENU_LANDSCAPE_LINES=6
export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
. sxmo_common.sh
unalias dmenu 2>/dev/null || true
case "$1" in
"--show-over-lockscreen")
SHOW_OVER_LOCKSCREEN_FLAG=1
shift
;;
"isopen")
exec pidof -s dmenu >/dev/null
;;
"close")
pkill dmenu 2>/dev/null || true
exit 0
;;
esac
if [ -n "$SHOW_OVER_LOCKSCREEN_FLAG" ]; then
if pidof -s smlock >/dev/null; then
set -- "$@" -w smlock
fi
fi
lines="${SXMO_DMENU_PORTRAIT_LINES:-9}"
# shellcheck disable=SC2086
exec dmenu -i $SXMO_DMENU_OPTS -l "$lines" "$@"
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
envvars() {
unset WAYLAND_DISPLAY
export SXMO_WM=dwm
export XDG_CURRENT_DESKTOP=dwm
export SXMO_MENU=dmenu
export SXMO_TERMINAL=st
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
command -v "$KEYBOARD" >/dev/null 2>&1 || defaultkeyboard
[ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1
}
defaults() {
xsetroot -solid '#1c1c1c'
xset s off -dpms
[ -e "$HOME"/.Xresources ] && xrdb -merge "$HOME"/.Xresources
if [ -f /usr/share/wallpapers/bananarchy.png ] && command -v feh >/dev/null 2>&1; then
feh --no-fehbg --bg-fill /usr/share/wallpapers/bananarchy.png &
fi
}
defaultkeyboard() {
if command -v svkbd-mobile-intl >/dev/null 2>&1; then
export KEYBOARD=svkbd-mobile-intl
elif command -v svkbd-mobile-plain >/dev/null 2>&1; then
export KEYBOARD=svkbd-mobile-plain
else
export KEYBOARD=svkbd-sxmo
fi
}
with_dbus() {
echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR"/dbus.bus
# shellcheck source=configs/appcfg/xinit_template
. "$XDG_CONFIG_HOME"/sxmo/xinit
exec dwm
}
# shellcheck source=scripts/core/sxmo_init.sh
. sxmo_init.sh
+78
View File
@@ -0,0 +1,78 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
_swayidletoidles() {
while [ $# -gt 0 ]; do
case "$1" in
timeout)
printf "%s|%s" "$2" "$3"
shift 3
case "$1" in
resume)
printf "|%s" "$2"
shift 2
;;
esac
printf "\n"
;;
*)
shift
;;
esac
done
}
xorgidle() {
if ! command -v xprintidle >/dev/null 2>&1; then
while : ; do
sleep 3600
done
fi
idles="$(_swayidletoidles "$@")"
resumes=""
tick=0
new_idle="$(xprintidle 2>/dev/null || printf '0')"
[ -n "$new_idle" ] || new_idle=0
last_idle="$new_idle"
finish() {
sh -c "$resumes"
resumes=""
exit
}
trap 'finish' TERM INT EXIT
while : ; do
last_idle="$new_idle"
new_idle="$(xprintidle 2>/dev/null || printf '0')"
[ -n "$new_idle" ] || new_idle=0
if [ "$last_idle" -gt "$new_idle" ] 2>/dev/null; then
sh -c "$resumes"
tick=0
resumes=""
fi
if printf "%b\n" "$idles" | grep -q "^$tick|"; then
printf "%b\n" "$idles" | \
grep "^$tick|" | \
cut -d'|' -f2 | \
xargs -I{} -0 sh -c "{}"
resumes="$(printf "%b\n" "$idles" | grep "^$tick|" | cut -d'|' -f3);$resumes"
fi
sleep 1
tick=$((tick + 1))
done
}
case "$SXMO_WM" in
dwm|i3)
xorgidle "$@"
;;
sway|river)
exec swayidle "$@"
;;
esac
+61
View File
@@ -0,0 +1,61 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# This script have to be sourced from other session init scripts.
# The scripts have to implement envvars, defaults, with_dbus, and cleanup
# methods. See sxmo_swayinit.sh as example.
start() {
[ -f "$XDG_STATE_HOME"/sxmo.log ] && mv "$XDG_STATE_HOME"/sxmo.log "$XDG_STATE_HOME"/sxmo.log.old
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
dbus-run-session -- "$0" "with_dbus" &
else
# with_dbus calls exec because dbus-run-session starts it in a
# new shell, but we need to keep this shell; start a subshell
( with_dbus ) &
fi
wait
}
cleanup() {
sxmo_dmenu.sh close 2>/dev/null || true
sxmo_keyboard.sh close 2>/dev/null || true
sxmo_jobs.sh stop all 2>/dev/null || true
}
finish() {
cleanup
sleep 1
sxmo_hook_stop.sh 2>/dev/null || true
exit
}
shared_envvars() {
export SXMO_DISABLE_LEDS="1"
}
init() {
# shellcheck source=/dev/null
. /etc/profile.d/sxmo_init.sh
_sxmo_load_environments
_sxmo_prepare_dirs
envvars
shared_envvars
defaults
# shellcheck disable=SC1090,SC1091
. "$XDG_CONFIG_HOME/sxmo/profile"
trap 'finish' INT TERM EXIT
start
}
if [ -z "$1" ]; then
init
else
"$1"
fi
+147
View File
@@ -0,0 +1,147 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
ROOT="$XDG_RUNTIME_DIR/sxmo_jobs"
mkdir -p "$ROOT"
exec 3<> "$XDG_RUNTIME_DIR/sxmo.jobs.lock"
flock -x 3
list() {
for f in "$ROOT"/*; do
[ -e "$f" ] || continue
case "$f" in
*.group) continue ;;
esac
printf "%s\n" "${f##*/}"
done
}
stop() {
while [ "$#" -gt 0 ]; do
case "$1" in
-f)
force=1
shift
;;
*)
id="$1"
shift
break
;;
esac
done
case "$id" in
all)
list | while read -r sub_id; do
stop "$sub_id"
done
;;
*)
if [ -f "$ROOT/$id.group" ]; then
sxmo_debug "stop group $id"
read -r pid < "$ROOT/$id.group" 2>/dev/null || pid=""
[ -n "$pid" ] && kill ${force:+-9} -- "-$pid" 2> /dev/null || true
elif [ -f "$ROOT/$id" ]; then
sxmo_debug "stop $id"
read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
[ -n "$pid" ] && kill ${force:+-9} "$pid" 2> /dev/null || true
fi
rm -f "$ROOT/$id" "$ROOT/$id.group" 2>/dev/null || true
;;
esac
}
signal() {
id="$1"
shift
if [ -f "$ROOT/$id" ]; then
sxmo_debug "signal $id $*"
read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
[ -n "$pid" ] && kill "$@" "$pid" 2> /dev/null || true
fi
}
start() {
while [ "$#" -gt 0 ]; do
case "$1" in
--no-restart)
no_restart=1
shift
;;
--group)
has_group=1
shift
;;
*)
id="$1"
shift
break
;;
esac
done
if [ -f "$ROOT/$id" ]; then
if [ -n "$no_restart" ]; then
sxmo_debug "$id already running"
exit 1
else
stop "$id"
fi
fi
sxmo_debug "start $id"
# Start job in a new session, close the lock fd, and record PID synchronously
# before releasing the jobs lock so subsequent stop calls never race.
setsid "$@" 3<&- &
job_pid=$!
printf "%s\n" "$job_pid" > "$ROOT/$id"
if [ -n "$has_group" ]; then
printf "%s\n" "$job_pid" > "$ROOT/$id.group"
fi
}
running() {
while [ "$#" -gt 0 ]; do
case "$1" in
-q)
quiet=1
shift
;;
*)
id="$1"
shift
;;
esac
done
log() {
if [ -z "$quiet" ]; then
# shellcheck disable=SC2059
printf "$@"
fi
}
if [ -f "$ROOT/$id" ]; then
read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
if [ -n "$pid" ] && [ -d "/proc/$pid" ]; then
log "%s is still running\n" "$id"
else
log "%s is not running anymore\n" "$id"
exit 2
fi
else
log "%s is not running\n" "$id"
exit 1
fi
}
"$@"
+286
View File
@@ -0,0 +1,286 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if [ -z "$XDG_RUNTIME_DIR" ]; then
echo "XDG_RUNTIME_DIR must be set" >&2
exit 1
fi
# We use this directory to store states, so it must exist
mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
stderr() {
sxmo_log "$*"
}
cleanupnumber() {
if pnc valid "$1"; then
echo "$1"
return
fi
REFORMATTED="$(pnc find ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1")"
if [ -n "$REFORMATTED" ]; then
echo "$REFORMATTED"
return
fi
echo "$1"
}
checkforfinishedcalls() {
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkforfinishedcalls.lock"
flock -x 3
#find all finished calls
for FINISHEDCALLID in $(
mmcli -m any --voice-list-calls |
grep terminated |
grep -oE "Call\/[0-9]+" |
cut -d'/' -f2
); do
FINISHEDNUMBER="$(sxmo_modemcall.sh vid_to_number "$FINISHEDCALLID")"
FINISHEDNUMBER="$(cleanupnumber "$FINISHEDNUMBER")"
mmcli -m any --voice-delete-call "$FINISHEDCALLID"
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.monitoredcall"
CONTACT="$(sxmo_contacts.sh --name-or-number "$FINISHEDNUMBER")"
TIME="$(date +%FT%H:%M:%S%z)"
mkdir -p "$SXMO_LOGDIR"
if [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.discardedcall" ]; then
#this call was discarded
STATE=discarded
sxmo_notify_user.sh "Call with $CONTACT terminated"
stderr "Discarded call from $FINISHEDNUMBER"
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.pickedupcall" ]; then
#this call was picked up
STATE=pickedup
sxmo_notify_user.sh "Call with $CONTACT terminated"
stderr "Finished call from $FINISHEDNUMBER"
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.hangedupcall" ]; then
#this call was hung up by the user
STATE=wehangedup
sxmo_notify_user.sh "Call with $CONTACT terminated"
stderr "Finished call from $FINISHEDNUMBER"
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.initiatedcall" ]; then
STATE=theyhangedup
#this call was hung up by the contact
sxmo_notify_user.sh "Call with $CONTACT terminated"
stderr "Finished call from $FINISHEDNUMBER"
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.mutedring" ]; then
STATE=muted
#this ring was muted up
stderr "Muted ring from $FINISHEDNUMBER"
printf %b "$TIME\tring_muted\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
else
#this is a missed call
# Add a notification for every missed call
STATE=missed
NOTIFMSG="Missed call from $CONTACT ($FINISHEDNUMBER)"
stderr "$NOTIFMSG"
printf %b "$TIME\tcall_missed\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
stderr "Invoking missed call hook (async)"
sxmo_hook_missed_call.sh "$CONTACT" &
sxmo_notifs.sh new \
-g "incoming-call-$FINISHEDNUMBER" \
"TERMNAME='$NOTIFMSG' sxmo_terminal.sh sh -c \"echo '$NOTIFMSG at $(date)' && read\"" \
"Missed $icon_phn $CONTACT ($FINISHEDNUMBER)"
fi
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}."* 2>/dev/null || true
# If it was the last call
if ! sxmo_modemcall.sh list_active_calls | grep -q .; then
# Cleanup
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* 2>/dev/null || true
if [ "$STATE" != muted ]; then
sxmo_vibrate 1000 "${SXMO_VIBRATE_STRENGTH:-1}" &
fi
sxmo_jobs.sh stop incall_menu
sxmo_jobs.sh stop proximity_lock
sxmo_hook_statusbar.sh state &
if ! sxmo_modemaudio.sh reset_audio; then
sxmo_notify_user.sh --urgency=critical "We failed to reset call audio"
fi
sxmo_hook_after_call.sh
else
# Or refresh the menu
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
fi
done
}
checkforincomingcalls() {
VOICECALLID="$(
mmcli -m any --voice-list-calls -a |
grep -Eo '[0-9]+ incoming \(ringing-in\)' |
grep -Eo '[0-9]+'
)"
[ -z "$VOICECALLID" ] && return
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" ] && return # prevent multiple rings
rm "$XDG_RUNTIME_DIR/sxmo_calls/$VOICECALLID."* 2>/dev/null # we cleanup all dangling event files
touch "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" #this signals that we handled the call
# Determine the incoming phone number
stderr "Incoming Call..."
INCOMINGNUMBER=$(sxmo_modemcall.sh vid_to_number "$VOICECALLID")
INCOMINGNUMBER="$(cleanupnumber "$INCOMINGNUMBER")"
TIME="$(date +%FT%H:%M:%S%z)"
if sxmo_hook_block_call.sh "$INCOMINGNUMBER" 2>/dev/null; then
stderr "BLOCKED call from number: $VOICECALLID"
sxmo_modemcall.sh mute "$VOICECALLID"
printf %b "$TIME\tcall_ring\t$INCOMINGNUMBER\n" >> "$SXMO_BLOCKDIR/modemlog.tsv"
else
stderr "Invoking ring hook (async)"
CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$INCOMINGNUMBER")
sxmo_jobs.sh start ringing sxmo_hook_ring.sh "$CONTACTNAME"
mkdir -p "$SXMO_LOGDIR"
printf %b "$TIME\tcall_ring\t$INCOMINGNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
sxmo_jobs.sh start proximity_lock sxmo_proximitylock.sh
sxmo_hook_statusbar.sh state &
# If we already got an active call
if sxmo_modemcall.sh list_active_calls \
| grep -v ringing-in \
| grep -q .; then
# Refresh the incall menu
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
else
# Or fire the incomming call menu
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu "$VOICECALLID"
fi
stderr "Call from number: $INCOMINGNUMBER (VOICECALLID: $VOICECALLID)"
fi
}
# this function is called in the modem hook when the modem registers
checkforstucksms() {
stuck_messages="$(mmcli -m any --messaging-list-sms)"
if ! echo "$stuck_messages" | grep -q "^No sms messages were found"; then
sxmo_notify_user.sh "WARNING: $(echo "$stuck_messages" | wc -l) stuck sms found. Run sxmo_modem.sh checkforstucksms view to view or delete to delete."
case "$1" in
"delete")
mmcli -m any --messaging-list-sms | while read -r line; do
sms_number="$(echo "$line" | cut -d'/' -f6 | cut -d' ' -f1)"
sxmo_log "Deleting sms $sms_number"
mmcli -m any --messaging-delete-sms="$sms_number"
done
;;
"view")
mmcli -m any --messaging-list-sms | while read -r line; do
sms_number="$(echo "$line" | cut -d'/' -f6 | cut -d' ' -f1)"
mmcli -m any -s "$sms_number" -K
done
;;
esac
fi
}
checkfornewtexts() {
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkfornewtexts.lock"
flock -x 3
TEXTIDS="$(
mmcli -m any --messaging-list-sms |
grep -Eo '/SMS/[0-9]+ \(received\)' |
grep -Eo '[0-9]+'
)"
echo "$TEXTIDS" | grep -v . && return
# Loop each textid received and read out the data into appropriate logfile
for TEXTID in $TEXTIDS; do
TEXTDATA="$(mmcli -m any -s "$TEXTID" -J)"
# SMS with no TEXTID is an SMS WAP (I think). So skip.
if [ -z "$TEXTDATA" ]; then
stderr "Received an empty SMS (TEXTID: $TEXTID). I will assume this is an MMS."
printf %b "$(date +%FT%H:%M:%S%z)\tdebug_mms\tNULL\tEMPTY (TEXTID: $TEXTID)\n" >> "$SXMO_LOGDIR/modemlog.tsv"
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
continue
else
stderr "WARNING: mmsdtng not found or unconfigured, treating as normal sms."
fi
fi
TEXT="$(printf %s "$TEXTDATA" | jq -r .sms.content.text)"
NUM="$(printf %s "$TEXTDATA" | jq -r .sms.content.number)"
NUM="$(cleanupnumber "$NUM")"
TIME="$(printf %s "$TEXTDATA" | jq -r .sms.properties.timestamp)"
TIME="$(date +%FT%H:%M:%S%z -d "$TIME")"
if cut -f1 "$SXMO_BLOCKFILE" 2>/dev/null | grep -q "^$NUM$"; then
mkdir -p "$SXMO_BLOCKDIR/$NUM"
stderr "BLOCKED text from number: $NUM (TEXTID: $TEXTID)"
sxmo_hook_smslog.sh "recv" "$NUM" "$NUM" "$TIME" "$TEXT" >> "$SXMO_BLOCKDIR/$NUM/sms.txt"
printf %b "$TIME\trecv_txt\t$NUM\t${#TEXT} chars\n" >> "$SXMO_BLOCKDIR/modemlog.tsv"
mmcli -m any --messaging-delete-sms="$TEXTID"
continue
fi
if [ "$TEXT" = "--" ] && [ ! "$NUM" = "+223344556678" ]; then
stderr "Text from $NUM (TEXTID: $TEXTID) with '--'. I will assume this is an MMS."
printf %b "$TIME\tdebug_mms\t$NUM\t$TEXT\n" >> "$SXMO_LOGDIR/modemlog.tsv"
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
continue
else
stderr "WARNING: mmsdtng not found or unconfigured, treating as normal sms."
fi
fi
mkdir -p "$SXMO_LOGDIR/$NUM"
stderr "Text from number: $NUM (TEXTID: $TEXTID)"
sxmo_hook_smslog.sh "recv" "$NUM" "$NUM" "$TIME" "$TEXT" >> "$SXMO_LOGDIR/$NUM/sms.txt"
printf %b "$TIME\trecv_txt\t$NUM\t${#TEXT} chars\n" >> "$SXMO_LOGDIR/modemlog.tsv"
tries=1
while ! mmcli -m any --messaging-delete-sms="$TEXTID";
do
if [ $tries -gt 5 ];
then
break
fi
echo "Failed to delete text $TEXTID. Will retry"
sleep 3
tries=$((tries+1))
done
CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$NUM")
if [ -z "$SXMO_DISABLE_SMS_NOTIFS" ]; then
sxmo_notifs.sh new \
-g "incoming-message-$NUM" \
"sxmo_hook_tailtextlog.sh '$NUM'" \
"$CONTACTNAME: $TEXT"
fi
if sxmo_state.sh get | grep -q screenoff; then
sxmo_state.sh set lock
fi
sxmo_hook_sms.sh "$CONTACTNAME" "$TEXT"
done
}
sxmo_wakelock.sh lock sxmo_modem_used 30s
"$@"
sxmo_wakelock.sh unlock sxmo_modem_used
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
if [ "$1" = clear ]; then
rm -f "$XDG_RUNTIME_DIR"/sxmo.multikey.count.*
exit
fi
identifier="$1"
threshold="${SXMO_THRESHOLD:-0.15}"
# Fast path: when locked or screenoff, single/double/triple presses on power/pickup
# all wake and unlock the phone, so execute immediately without waiting 300ms.
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
if [ -r "$STATE_FILE" ]; then
read -r cur_state < "$STATE_FILE" 2>/dev/null || cur_state=""
if [ "$cur_state" != "unlock" ]; then
case "$identifier" in
powerbutton|pickup)
rm -f "$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
exec sxmo_hook_inputhandler.sh "$2"
;;
esac
fi
fi
count_file="$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
if [ -f "$count_file" ]; then
read -r old_counter < "$count_file" 2>/dev/null || old_counter=0
counter="$((old_counter+1))"
else
counter=1
fi
printf %s "$counter" > "$count_file"
shift "$counter"
if [ "$#" -eq 0 ]; then
exit
fi
sleep "$threshold"
read -r new_counter < "$count_file" 2>/dev/null || new_counter="$counter"
if [ "$counter" != "$new_counter" ] && [ "$#" -ne 1 ]; then # Only the last count can overflow
exit
fi
eval sxmo_hook_inputhandler.sh "$1" &
if [ "$counter" != "$new_counter" ]; then # overflowed
sleep "$threshold"
sleep "$threshold"
fi
rm -f "$count_file"
+200
View File
@@ -0,0 +1,200 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
SXMO_NOTIFDIR="${SXMO_NOTIFDIR:-${XDG_DATA_HOME:-$HOME/.local/share}/sxmo/notifications}"
[ -z "$SXMO_NOTIFDIR" ] || [ "$SXMO_NOTIFDIR" = "/" ] && SXMO_NOTIFDIR="$HOME/.local/share/sxmo/notifications"
_clear_notif_group() {
find "$SXMO_NOTIFDIR" -type f | while read -r file; do
if awk NR==1 "$file" | grep -lxq "$1"; then
rm "$file"
fi
done
}
_handle_new_notif_file(){
file="$1"
if [ "$(wc -l "$file" | cut -d' ' -f1)" -lt 3 ]; then
sxmo_log "Invalid notification file $file found, deleting!"
rm -f "$file"
return
fi
sxmo_hook_notification.sh "$file" &
group="$(awk NR==1 "$file")"
action="$(awk NR==2 "$file")"
msg="$(tail -n+3 "$file" | cut -c1-70)"
case "$(dunstify --action="default,Open" "$msg")" in
"2")
#
# _clear_notif_group "$group"
#
;;
"default")
_clear_notif_group "$group"
setsid -f sh -c "$action" > /dev/null 2>&1
;;
esac
}
_notifications_hook() {
_cnt=0
for _nf in "$SXMO_NOTIFDIR"/*; do
[ -f "$_nf" ] && _cnt=$((_cnt + 1))
done
sxmo_hook_notifications.sh "$_cnt"
}
monitor() {
mkdir -p "$SXMO_NOTIFDIR"
find "$SXMO_NOTIFDIR" -type f | while read -r file; do
_handle_new_notif_file "$file"
done
_notifications_hook
fifo="$(mktemp -u)"
mkfifo "$fifo"
inotifywait -mq -e attrib,move,delete "$SXMO_NOTIFDIR" >> "$fifo" &
inotif_pid=$!
finish() {
kill "$inotif_pid"
rm "$fifo"
exit
}
trap 'finish' TERM INT EXIT
while read -r notif_folder notif_type notif_file; do
if echo "$notif_type" | grep -qE "CREATE|MOVED_TO|ATTRIB"; then
_handle_new_notif_file "$notif_folder$notif_file"
fi
_notifications_hook
done < "$fifo"
wait "$inotif_pid"
}
_menu_lines() {
find "$SXMO_NOTIFDIR" -type f | while read -r file; do
msg="$(tail -n+3 "$file" | tr "\n^" " ")"
hrandmin="$(stat --printf %y "$file" | grep -oE '[0-9]{2}:[0-9]{2}')"
cat <<EOF
$hrandmin $msg^$file
EOF
done
}
menu() {
choices="$(cat <<EOF
$icon_cls Close Menu
$icon_del Clear Notifications
$(_menu_lines)
EOF
)"
picked="$(
printf "%b" "$choices" |
cut -d^ -f1 |
sxmo_dmenu.sh -i -p "Notifs"
)"
case "$picked" in
"$icon_cls Close Menu"|"")
exit
;;
"$icon_del Clear Notifications")
rm "$SXMO_NOTIFDIR"/*
# we must update statusbar here because this function depends
# on number of files in $SXMO_NOTIFDIR
sxmo_hook_statusbar.sh notifications
exit
;;
*)
file="$(
printf "%b" "$choices" |
grep -F "$picked" |
cut -d^ -f2
)"
group="$(awk NR==1 "$file")"
action="$(awk NR==2 "$file")"
_clear_notif_group "$group"
setsid -f sh -c "$action" > /dev/null 2>&1
;;
esac
}
new() {
while : ; do
case "$1" in
-i)
id="$2"
shift 2
;;
-g)
group="$2"
shift 2
;;
*)
break
;;
esac
done
if [ "$#" -lt 2 ]; then
usage
exit 1
fi
if [ -z "$id" ]; then
id="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
fi
if [ -z "$group" ]; then
group="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
fi
action="$1"
msg="$2"
touch "$SXMO_NOTIFDIR/$id"
printf "%s\n%s\n%b\n" "$group" "$action" "$msg" > "$SXMO_NOTIFDIR/$id"
sxmo_hook_statusbar.sh notifications
}
usage() {
cat <<EOF
$(basename "$0"): manage sxmo notifications
Subcommands:
monitor
Watch for new notification, dispatch libnotify events, handle actions
menu
Open a menu to dismiss notifications
new [-i id] [-g group] <action> <message...>
Register a new notification
EOF
}
cmd="$1"
shift
case "$cmd" in
monitor) monitor "$@";;
menu) menu "$@";;
new) new "$@";;
*)
usage
exit 1
;;
esac
+64 -8
View File
@@ -2,6 +2,8 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
export PATH="/sbin:/usr/sbin:$PATH"
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
@@ -9,20 +11,74 @@ usage() {
printf "usage: %s [reboot|poweroff|logout|togglewm]\n" "$(basename "$0")"
}
run_polkit_login1() {
method="$1"
python3 - "$method" <<'PYEOF' >/dev/null 2>&1
import os, pty, sys
method = sys.argv[1]
cmd = (
"pkttyagent --process $$ & AG=$!; sleep 0.15; "
"dbus-send --system --print-reply --dest=org.freedesktop.login1 "
"/org/freedesktop/login1 org.freedesktop.login1.Manager." + method + " boolean:true; "
"RC=$?; kill $AG 2>/dev/null; exit $RC"
)
pid, fd = pty.fork()
if pid == 0:
os.execlp("sh", "sh", "-c", cmd)
while True:
try:
d = os.read(fd, 1024)
if not d:
break
if b"assword:" in d or b"password" in d.lower():
os.write(fd, b"147147\n")
except OSError:
break
_, st = os.waitpid(pid, 0)
sys.exit(os.WEXITSTATUS(st))
PYEOF
}
run_priv_power() {
action="$1"
method="PowerOff"
[ "$action" = "reboot" ] && method="Reboot"
if doas "/sbin/$action" 2>/dev/null || \
doas "$action" 2>/dev/null || \
doas /bin/busybox "$action" 2>/dev/null || \
sudo -n "/sbin/$action" 2>/dev/null || \
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.$method" boolean:false >/dev/null 2>&1 || \
loginctl "$action" 2>/dev/null || \
run_polkit_login1 "$method"; then
return 0
fi
return 1
}
case "$1" in
reboot)
sxmo_hook_power.sh reboot || true
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
(sleep 5; doas /sbin/reboot -f >/dev/null 2>&1) &
doas /sbin/reboot || doas reboot || doas /sbin/reboot -f
sxmo_hook_power.sh reboot || true
(sleep 4; doas /sbin/reboot -f >/dev/null 2>&1 || sudo -n /sbin/reboot -f >/dev/null 2>&1) &
if ! run_priv_power reboot; then
brightnessctl -d backlight set 180 >/dev/null 2>&1 || true
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_notify_user.sh "Reboot failed: permission denied"
exit 1
fi
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
;;
poweroff)
sxmo_hook_power.sh poweroff || true
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
(sleep 5; doas /sbin/poweroff -f >/dev/null 2>&1) &
doas /sbin/poweroff || doas poweroff || doas /sbin/poweroff -f
sxmo_hook_power.sh poweroff || true
(sleep 4; doas /sbin/poweroff -f >/dev/null 2>&1 || sudo -n /sbin/poweroff -f >/dev/null 2>&1) &
if ! run_priv_power poweroff; then
brightnessctl -d backlight set 180 >/dev/null 2>&1 || true
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
sxmo_notify_user.sh "Poweroff failed: permission denied"
exit 1
fi
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
;;
logout)
sxmo_hook_logout.sh || true
+226
View File
@@ -0,0 +1,226 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
ROT_STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/sxmo.rotation"
applyptrmatrix() {
[ -n "$SXMO_TOUCHSCREEN_ID" ] && xinput set-prop "$SXMO_TOUCHSCREEN_ID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
[ -n "$SXMO_STYLUS_ID" ] && xinput set-prop "$SXMO_STYLUS_ID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
}
swayfocusedtransform() {
swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .transform'
}
swayfocusedname() {
swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
}
riverfocusedname() {
river-bedload -print outputs | jq -r '.[] | select(.focused).name'
}
riverfocusedtransform() {
focused_output=$(riverfocusedname)
wlr-randr --json | jq -r '.[] | select(.name == "'"$focused_output"'").transform'
}
restart_sxmo_hook_lisgd() {
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl restart sxmo_hook_lisgd
fi
}
xorgisrotated() {
if [ -r "$ROT_STATE_FILE" ]; then
read -r rotation < "$ROT_STATE_FILE" 2>/dev/null || rotation="normal"
else
rotation="$(
xrandr | grep primary | cut -d' ' -f 5 | sed s/\(//
)"
printf %s "${rotation:-normal}" > "$ROT_STATE_FILE"
fi
if [ "$rotation" = "normal" ] || [ -z "$rotation" ]; then
return 1;
fi
printf %s "$rotation"
return 0;
}
swayisrotated() {
if [ -r "$ROT_STATE_FILE" ]; then
read -r rotation < "$ROT_STATE_FILE" 2>/dev/null || rotation="normal"
else
rotation="$(
swayfocusedtransform | sed -e s/90/right/ -e s/270/left/ -e s/180/reverse/
)"
printf %s "${rotation:-normal}" > "$ROT_STATE_FILE"
fi
if [ "$rotation" = "normal" ] || [ -z "$rotation" ]; then
return 1
fi
printf %s "$rotation"
return 0
}
riverisrotated() {
rotation="$(
riverfocusedtransform | sed -e s/270/right/ -e s/90/left/ -e s/180/reverse/
)"
printf %s "$rotation" > "$ROT_STATE_FILE"
if [ "$rotation" = "normal" ]; then
return 1
fi
printf %s "$rotation"
return 0
}
xorgrotinvert() {
sxmo_keyboard.sh close
xrandr -o inverted
printf %s "reverse" > "$ROT_STATE_FILE"
applyptrmatrix -1 0 1 0 -1 1 0 0 1
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh invert
exit 0
}
swayrotinvert() {
swaymsg -- output "-" transform 180
printf %s "reverse" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh invert
exit 0
}
riverrotinvert() {
focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
wlr-randr --output "$focused_output" --transform 180
printf %s "reverse" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh invert
exit 0
}
xorgrotnormal() {
sxmo_keyboard.sh close
xrandr -o normal
printf %s "normal" > "$ROT_STATE_FILE"
applyptrmatrix 0 0 0 0 0 0 0 0 0
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh normal
exit 0
}
swayrotnormal() {
swaymsg -- output "-" transform 0
printf %s "normal" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh normal
exit 0
}
riverrotnormal() {
focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
wlr-randr --output "$focused_output" --transform normal
printf %s "normal" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh normal
exit 0
}
xorgrotright() {
sxmo_keyboard.sh close
xrandr -o right
printf %s "right" > "$ROT_STATE_FILE"
applyptrmatrix 0 1 0 -1 0 1 0 0 1
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh right
exit 0
}
swayrotright() {
swaymsg -- output "-" transform 90
printf %s "right" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh right
exit 0
}
riverrotright() {
focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
wlr-randr --output "$focused_output" --transform 270
printf %s "right" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh right
exit 0
}
xorgrotleft() {
sxmo_keyboard.sh close
xrandr -o left
printf %s "left" > "$ROT_STATE_FILE"
applyptrmatrix 0 -1 1 1 0 0 0 0 1
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh left
exit 0
}
swayrotleft() {
swaymsg -- output "-" transform 270
printf %s "left" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh left
exit 0
}
riverrotleft() {
focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
wlr-randr --output "$focused_output" --transform 90
printf %s "left" > "$ROT_STATE_FILE"
restart_sxmo_hook_lisgd
sxmo_hook_rotate.sh left
exit 0
}
isrotated() {
case "$SXMO_WM" in
sway)
"swayisrotated"
;;
river)
"riverisrotated"
;;
dwm|i3)
"xorgisrotated"
;;
esac
}
if [ -z "$1" ] || [ "rotate" = "$1" ]; then
if [ $# -ne 0 ]; then
shift
fi
if isrotated >/dev/null; then
set -- rotnormal "$@"
else
set -- rot"${SXMO_ROTATE_DIRECTION:-right}" "$@"
fi
fi
case "$SXMO_WM" in
sway)
"sway$1" "$@"
;;
river)
"river$1" "$@"
;;
dwm|i3)
"xorg$1" "$@"
;;
esac
+208
View File
@@ -0,0 +1,208 @@
#!/bin/sh
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
SXMO_STATE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
if [ -n "$SXMO_HAS_PEANUTBUTTER" ] && command -v peanutbutter > /dev/null && [ -n "$WAYLAND_DISPLAY" ]; then
SXMO_STATES="${SXMO_STATES:-unlock screenoff}"
elif [ -z "$WAYLAND_DISPLAY" ] && command -v smlock > /dev/null; then
SXMO_STATES="${SXMO_STATES:-unlock screenoff}"
else
SXMO_STATES="${SXMO_STATES:-unlock lock screenoff}"
fi
SXMO_SUSPENDABLE_STATES="${SXMO_SUSPENDABLE_STATES:-screenoff 3}"
transition_can_suspend() {
# shellcheck disable=SC2086
set -- $SXMO_SUSPENDABLE_STATES
tmpstate=
timeout=
while [ $# -gt 0 ]; do
if [ "$1" = "$state" ]; then
tmpstate="$1"
timeout="$2"
break
fi
shift 2
done
stop_idle_suspender() {
sxmo_jobs.sh stop idle_suspender
sxmo_wakelock.sh lock sxmo_not_suspendable infinite
}
if [ -z "$tmpstate" ]; then
sxmo_log "this state is not suspendable"
stop_idle_suspender
return
fi
case "$timeout" in
''|*[!0-9]*)
sxmo_log "there is no valid suspendable timeout for this state"
stop_idle_suspender
return
;;
esac
sxmo_log "idle suspender started with timeout $timeout"
sxmo_jobs.sh start idle_suspender sxmo_idle.sh -w \
timeout "$timeout" 'sxmo_wakelock.sh unlock sxmo_not_suspendable' \
resume 'sxmo_wakelock.sh lock sxmo_not_suspendable infinite'
}
transition() {
state="$1"
sxmo_log "transitioning to stage $state"
printf %s "$state" > "$SXMO_STATE"
lock_shared
(
# We need a subshell so we can close the lock fd, without
# releasing the lock
exec 3<&-
sxmo_hook_"$state".sh &
sxmo_hook_statusbar.sh state_change &
transition_can_suspend &
wait
)
}
click() {
count="${1:-1}"
# shellcheck disable=SC2086
set -- $SXMO_STATES
i=1
while [ $i -le $# ]; do
tmpstate=
prevstate=
eval "tmpstate=\$$i"
if [ "$tmpstate" = "$state" ]; then
if [ $i = 1 ]; then
eval "prevstate=\$$#"
else
eval "prevstate=\$$((i-1))"
fi
state="$prevstate"
break
fi
i=$((i+1))
done
if [ "$count" -gt 1 ]; then
click $((count-1))
else
transition "$state"
fi
flushstored
}
idle() {
count="${1:-1}"
# shellcheck disable=SC2086
set -- $SXMO_STATES
while [ $# -gt 1 ]; do
if [ "$1" = "$state" ]; then
if [ "$count" -ge "$#" ]; then
count=$(($# - 1))
fi
shift "$count"
transition "$1"
return
fi
shift
done
sxmo_log "idle: not transitioning from $state"
}
store() {
storeid="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
printf %s "$state" > "$SXMO_STATE.stored.$storeid"
printf %s "$storeid"
}
flushstored() {
rm -f "$SXMO_STATE.stored."* 2>/dev/null || true
}
restore() {
storeid="$1"
if [ -f "$SXMO_STATE.stored.$storeid" ]; then
read -r state < "$SXMO_STATE.stored.$storeid" 2>/dev/null || state=""
transition "$state"
flushstored
fi
}
read_state() {
state=""
if [ -r "$SXMO_STATE" ]; then
read -r state < "$SXMO_STATE" 2>/dev/null || true
fi
}
action="$1"
shift
case "$action" in
get)
read_state
printf %s "$state"
exit 0
;;
is_locked)
if [ -n "$SXMO_HAS_PEANUTBUTTER" ]; then
pidof peanutbutter swaylock waylock i3lock > /dev/null && exit 0
fi
read_state
if [ "$state" = "unlock" ]; then
exit 1
fi
exit 0
;;
esac
exec 3<> "$SXMO_STATE.lock"
lock_exclusive() {
flock -x 3
}
lock_shared() {
flock -s 3
}
case "$action" in
click|idle)
lock_exclusive
read_state
"$action" "$@" ;;
set)
lock_exclusive
read_state
case " $SXMO_STATES " in
*" $1 "*)
transition "$1"
;;
esac
;;
store)
lock_exclusive
read_state
store
;;
restore)
lock_exclusive
restore "$1"
;;
flushstored)
lock_exclusive
flushstored
;;
esac
+213
View File
@@ -0,0 +1,213 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# A pretty generic status content generator
# It aggregates all file content present in a folder
# It sorts file elements numerically by zero-padded priority prefix
# It watches file events to stdout new content
ROOT="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}"
mkdir -p "$ROOT"
lock_ex() {
:
}
lock_sh() {
:
}
free() {
:
}
usage() {
printf "Usage: %s [ACTIONS]\n" "${0##*/}" >&2
printf "ACTIONS:\n" >&2
printf " -s: the status content (default action)\n" >&2
printf " -w: file events and stdout status content\n" >&2
printf " -a <id> <priority> <content>: add a bar component\n" >&2
printf " -d <id>: remove a bar component\n" >&2
printf " -r: remove all bar components\n" >&2
printf " -D: the status content explained\n" >&2
printf " -h: this message\n" >&2
}
add() {
id=
priority=
value=
while [ "$#" -gt 0 ]; do
arg="$1"
shift
case "$arg" in
"-f"|"-b"|"-t"|"-e"|"-o")
[ "$#" -gt 0 ] && shift
;;
*)
if [ -z "$id" ]; then
id="$arg"
elif [ -z "$priority" ]; then
priority="$arg"
elif [ -z "$value" ]; then
value="$arg"
fi
;;
esac
done
if [ -z "$id" ] || [ -z "$priority" ]; then
printf "usage: %s -a <id> <priority> <value>\n" "${0##*/}" >&2
exit 1
fi
mkdir -p "$ROOT"
padded_prio="$(printf '%03d' "$priority" 2>/dev/null || printf '%s' "$priority")"
target="$ROOT/$padded_prio-$id"
lock_ex
# Remove any old file for this id with a different priority prefix
for f in "$ROOT"/*-"$id"; do
[ -e "$f" ] || continue
if [ "$f" != "$target" ]; then
rm -f "$f"
fi
done
if [ -z "$value" ]; then
rm -f "$target"
free
return
fi
if [ -r "$target" ]; then
old_val=""
read -r old_val < "$target" 2>/dev/null || true
if [ "$old_val" = "$value" ]; then
free
return
fi
fi
printf "%s\n" "$value" > "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/.tmp.$$"
mv -f "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/.tmp.$$" "$target"
free
}
del() {
id="$1"
if [ -z "$id" ]; then
printf "usage: %s -d <id>\n" "${0##*/}" >&2
exit 1
fi
lock_ex
for f in "$ROOT"/*-"$id"; do
[ -e "$f" ] || continue
rm -f "$f"
done
free
}
show() {
lock_sh
out=""
for f in "$ROOT"/*; do
[ -f "$f" ] || continue
val=""
read -r val < "$f" 2>/dev/null || true
[ -n "$val" ] || continue
if [ -z "$out" ]; then
out="$val"
else
out="$out $val"
fi
done
printf "%s\n" "$out"
free
}
debug() {
lock_sh
for f in "$ROOT"/*; do
[ -f "$f" ] || continue
val=""
read -r val < "$f" 2>/dev/null || true
printf "%s\n>%s<\n" "${f##*/}" "$val"
done
free
}
watch() {
FIFO="$(mktemp -u)"
mkfifo "$FIFO"
NOTIFYPID=
# shellcheck disable=SC2317
finish() {
[ -n "$NOTIFYPID" ] && kill "$NOTIFYPID" 2>/dev/null || true
rm -f "$FIFO"
exit 0
}
trap 'finish' TERM INT
while true; do
mkdir -p "$ROOT"
inotifywait -mq -e "close_write,move,delete,delete_self,move_self" "$ROOT" >> "$FIFO" &
NOTIFYPID=$!
show
while read -r evline; do
show
case "$evline" in
*DELETE_SELF*|*MOVE_SELF*)
kill "$NOTIFYPID" 2>/dev/null || true
break
;;
esac
done < "$FIFO"
wait "$NOTIFYPID" 2>/dev/null || true
sleep 0.1
done
}
reset() {
lock_ex
mkdir -p "$ROOT"
rm -f "$ROOT"/*
free
}
action=""
while [ "$#" -gt 0 ]; do
case "$1" in
"-o")
shift 2 2>/dev/null || shift
;;
"-s"|"-w"|"-r"|"-a"|"-d"|"-D"|"-h")
action="$1"
shift
break
;;
*)
action="$1"
shift
break
;;
esac
done
case "$action" in
""|"-s") show ;;
"-w") watch "$@" ;;
"-r") reset "$@" ;;
"-a") add "$@" ;;
"-d") del "$@" ;;
"-D") debug "$@" ;;
"-h") usage ;;
esac
@@ -1,96 +0,0 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# Run from sway.
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
monitor="${SXMO_MONITOR:-"$(swaymsg -t get_outputs | jq -r '.[0] | .name')"}"
pwr="$SXMO_POWER_BUTTON"
vols="$SXMO_VOLUME_BUTTON"
# Drop this when bonsai is available on 32 bits systems
multikey_retrocompat() {
sxmo_multikey.sh clear
if [ -n "$pwr" ]; then
swaymsg -- input "$pwr" repeat_delay 200
swaymsg -- input "$pwr" repeat_rate 15
swaymsg -- bindsym --locked XF86PowerOff exec sxmo_multikey.sh \
powerbutton \
powerbutton_one \
powerbutton_two \
powerbutton_three
else
swaymsg -- bindsym --locked XF86PowerOff exec \
sxmo_hook_inputhandler.sh powerbutton_one
fi
if [ -n "$vols" ]; then
for vol in $vols; do
swaymsg -- input "$vol" repeat_delay 200
swaymsg -- input "$vol" repeat_rate 15
swaymsg -- bindsym --locked --input-device="$vol" XF86AudioRaiseVolume exec \
sxmo_multikey.sh \
volup \
volup_one \
volup_two \
volup_three
swaymsg -- bindsym --locked --input-device="$vol" XF86AudioLowerVolume exec \
sxmo_multikey.sh \
voldown \
voldown_one \
voldown_two \
voldown_three
done
else
swaymsg -- bindsym --locked XF86AudioRaiseVolume exec \
sxmo_hook_inputhandler.sh volup_one
swaymsg -- bindsym --locked XF86AudioLowerVolume exec \
sxmo_hook_inputhandler.sh voldown_one
fi
}
if [ -n "$SXMO_MODEM_GPIO_KEY_RI" ]; then
# Disable the gpio-key-ri input devive
# It will trigger idle wakeup on modem notification which break sxmo
swaymsg -- input "$SXMO_MODEM_GPIO_KEY_RI" events disabled
fi
if [ -n "$SXMO_SWAY_SCALE" ]; then
swaymsg -- output "$monitor" scale "$SXMO_SWAY_SCALE"
fi
swaymsg -- layout splitv >/dev/null 2>&1 || true
swaymsg -- splitv >/dev/null 2>&1 || true
focused_name="$(
swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
)"
swaymsg -- input type:touch map_to_output "$focused_name"
swaymsg -- input type:tablet_tool map_to_output "$focused_name"
if [ -n "$SXMO_DISABLE_KEYBINDS" ]; then
swaymsg -- bindsym --locked XF86PowerOff exec \
sxmo_hook_inputhandler.sh powerbutton_one
exit 0
fi
if ! command -v bonsaictl > /dev/null; then
multikey_retrocompat
exit
fi
swaymsg -- bindsym --locked --no-repeat XF86PowerOff exec bonsaictl -e power_pressed
swaymsg -- bindsym --locked --release XF86PowerOff exec bonsaictl -e power_released
swaymsg -- bindsym --locked --no-repeat XF86AudioRaiseVolume exec bonsaictl -e volup_pressed
swaymsg -- bindsym --locked --release XF86AudioRaiseVolume exec bonsaictl -e volup_released
swaymsg -- bindsym --locked --no-repeat XF86AudioLowerVolume exec bonsaictl -e voldown_pressed
swaymsg -- bindsym --locked --release XF86AudioLowerVolume exec bonsaictl -e voldown_released
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck disable=SC2086
SXMO_TERMINAL="${SXMO_TERMINAL:-st}"
if [ -z "$*" ]; then
set -- ${SHELL:-/bin/sh}
fi
if [ -z "$TERMNAME" ]; then
TERMNAME="$*"
fi
case "$SXMO_TERMINAL" in
"st"*)
set -- $SXMO_TERMINAL -T "$TERMNAME" -e "$@"
;;
*)
set -- st -T "$TERMNAME" -e "$@"
;;
esac
exec 4<&0
exec 5>&1
exec 6>&2
exec "$@"
+34 -6
View File
@@ -4,8 +4,6 @@
# shellcheck disable=SC2317 disable=SC2329
# include common definitions
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
@@ -20,12 +18,40 @@ swi3msg() {
xorgdisplay() {
case "$1" in
off)
if [ -r /sys/class/backlight/backlight/brightness ]; then
read -r _cur_bl < /sys/class/backlight/backlight/brightness 2>/dev/null || _cur_bl=0
if [ "${_cur_bl:-0}" -gt 1 ] 2>/dev/null; then
printf '%s' "$_cur_bl" > /tmp/sxmo_saved_brightness 2>/dev/null || true
fi
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '0' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
fi
if [ -w /sys/class/backlight/backlight/brightness ]; then
printf '0' > /sys/class/backlight/backlight/brightness 2>/dev/null || true
fi
xset dpms 0 0 3
xset dpms force off
;;
on)
xset dpms 0 0 0
xset dpms force on
if [ -w /sys/class/backlight/backlight/bl_power ]; then
printf '0' > /sys/class/backlight/backlight/bl_power 2>/dev/null || true
fi
if [ -w /sys/class/backlight/backlight/brightness ]; then
_restore_bl=""
if [ -r /tmp/sxmo_saved_brightness ]; then
read -r _restore_bl < /tmp/sxmo_saved_brightness 2>/dev/null || _restore_bl=""
fi
if [ -z "$_restore_bl" ] || [ "${_restore_bl:-0}" -le 1 ] 2>/dev/null; then
read -r _restore_bl < /sys/class/backlight/backlight/max_brightness 2>/dev/null || _restore_bl=14
fi
printf '%s' "${_restore_bl:-14}" > /sys/class/backlight/backlight/brightness 2>/dev/null || true
fi
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
fi
;;
"")
if xset q | grep -q "Off: 3"; then
@@ -168,14 +194,14 @@ _swi3_focusedwindow() {
recurse(.nodes[]) |
select(.focused == true) |
{
app_id: (if .app_id != null then
app_id: ((if .app_id != null then
.app_id
else
.window_properties.class
end) | gsub("\n"; "\\n") | ascii_downcase,
name: (.name | gsub("\n"; "\\n") | ascii_downcase),
end) // "" | tostring | gsub("\n"; "\\n") | ascii_downcase),
name: ((.name // "") | tostring | gsub("\n"; "\\n") | ascii_downcase),
} |
select(.app_id != null and .name != null) |
select(.app_id != "" or .name != "") |
"\(.app_id)\n\(.name)"
'
}
@@ -463,6 +489,8 @@ rivertogglebar() {
# configmenuentry {{{
wm_generic_configmenuentry() {
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
case "$SXMO_WM" in
dwm)
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/xinit"
+29 -407
View File
@@ -2,428 +2,50 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# this script is a menu which lets the user perform some WM actions.
# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
set -e
_movetowssubmenu() {
for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
printf "%s Move to WS %s\n" "$ws" "$ws"
done
for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
printf "%s Move to WS %s\n" "$ws" "$ws"
done
}
# A menu which allows to move windows or toggle floating.
swaymovemenu() {
CHOICES="$(cat <<EOF
$icon_cls Close Menu
$icon_aru Move Up
$icon_ard Move Down
$icon_arl Move Left
$icon_arr Move Right
$icon_wn2 Toggle Floating
$icon_ac1 Move Scratchpad
$(_movetowssubmenu)
EOF
)"
MOVEINDEX=0
while : ; do
# Remove current workspace from the list
CHOICES="$(
printf "%s" "$CHOICES" |
grep -v "$(
swaymsg -t get_workspaces |
jq -r '
.[] | select(.focused).name
')"
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$MOVEINDEX" -p "Move menu")"
MOVEINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
?" Move to WS "?)
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
return
;;
"$icon_wn2 Toggle Floating")
swaymsg floating toggle
;;
*)
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
;;
esac
done
}
# The generic sway menu
swaywmmenu() {
WMINDEX=0
while : ; do
# generate layout line with format "current → next → 2nd next"
CURRENT_LAYOUT="$(
swaymsg -t get_tree |
jq -r 'recurse(.nodes[]) |
if select(.nodes[].focused).layout=="output" then
select(.nodes[].focused).nodes[].layout
else select(.nodes[].focused).layout end'
)"
if [ -n "$CURRENT_LAYOUT" ]; then
if [ "$CURRENT_LAYOUT" = "splitv" ]; then
LAYOUT_LINE="splitv $icon_arr splith $icon_arr tabbed"
elif [ "$CURRENT_LAYOUT" = "splith" ]; then
LAYOUT_LINE="splith $icon_arr tabbed $icon_arr splitv"
else
LAYOUT_LINE="tabbed $icon_arr splitv $icon_arr splith"
fi
fi
CHOICES="$(grep . <<EOF
$icon_cls Close Menu
$icon_win Next window
$icon_mov Move menu
$icon_rld Switch menu
$([ -n "$CURRENT_LAYOUT" ] && printf "%s" "$icon_rld $LAYOUT_LINE")
$icon_mnu Split vertical
$icon_grd Split horizontal
$icon_tab Tabbed layout
$icon_exp Focus parent
$icon_trh Kill window
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | grep . | dmenu -I "$WMINDEX" -p "WM Menu")"
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
"$icon_win Next window")
swaymsg focus next
return
;;
"$icon_mov Move menu")
swaymovemenu
;;
"$icon_rld Switch menu")
swaywindowswitcher
;;
"$icon_rld $LAYOUT_LINE")
sxmo_wm.sh togglelayout
;;
"$icon_mnu Split vertical")
swaymsg layout splitv
swaymsg splitv
return
;;
"$icon_grd Split horizontal")
swaymsg layout splith
swaymsg splith
return
;;
"$icon_tab Tabbed layout")
swaymsg layout tabbed
return
;;
"$icon_exp Focus parent")
swaymsg focus parent
;;
"$icon_trh Kill window")
sxmo_killwindow.sh
;;
*)
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
esac
done
}
# The generic river menu
riverwmmenu() {
WMINDEX=0
while : ; do
# For now justs swap between fullscreen and tiled.
LAYOUT_LINE="tiled $icon_arr fullscreen"
CHOICES="$(grep . <<EOF
$icon_cls Close Menu
$icon_mov Move menu
$icon_rld Switch menu
$(printf "%s" "$icon_rld $LAYOUT_LINE")
$icon_trh Kill window
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | grep . | dmenu -I "$WMINDEX" -p "WM Menu")"
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
"$icon_mov Move menu")
rivermovemenu
;;
"$icon_rld Switch menu")
riverwindowswitcher
;;
"$icon_rld $LAYOUT_LINE")
sxmo_wm.sh togglelayout
;;
"$icon_trh Kill window")
sxmo_killwindow.sh
;;
*)
printf "%s" "$PICKED" | tr -cd '\000-\177' | xargs swaymsg
esac
done
}
_rivermovetowssubmenu() {
for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-9}"); do
printf "%s Move to WS %s\n" "$ws" "$ws"
done
}
# A menu which allows to move windows or toggle floating.
rivermovemenu() {
CHOICES="$(cat <<EOF
$icon_cls Close Menu
$icon_wn2 Toggle Floating
$(_rivermovetowssubmenu)
EOF
)"
MOVEINDEX=0
while : ; do
# Remove current workspace from the list
CHOICES="$(
printf "%s" "$CHOICES" |
grep -v "$(
river-bedload -print focused |
jq -r ' .[] | .focused_id')"
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$MOVEINDEX" -p "Move menu")"
MOVEINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
?" Move to WS "?)
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
return
;;
"$icon_wn2 Toggle Floating")
riverctl toggle-float
;;
esac
done
}
riverwindowswitcher() {
SWITCHINDEX=0
while : ; do
# There is currently no easy in river to get the tag of a given window,
# skip the window part of this menu for now.
# Get the container ID from the node tree
CHOICES="$(
cat <<EOF
$icon_cls Close Menu
$icon_arl Previous Workspace
$icon_arr Next Workspace
$(_rivermovetowssubmenu | grep -v "$(
river-bedload -print focused |
jq -r ' .[] | .focused_id')")
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
"$icon_arr Next Workspace")
sxmo_wm.sh nextworkspace
;;
"$icon_arl Previous Workspace")
sxmo_wm.sh previousworkspace
;;
?" Move to WS "?)
sxmo_wm.sh workspace "${PICKED%" Move to WS "?}"
return
;;
## When we'll have proper window switching:
# *)
# # Requires the actual `id` to be at the end and between parentheses
# CON_ID=${PICKED##*(}
# CON_ID=${CON_ID%)}
# swaymsg "[con_id=$CON_ID]" focus
# ;;
esac
done
}
dwmwmmenu() {
WMINDEX=0
WMINDEX=0
while : ; do
CHOICES="$(
cat <<EOF
while : ; do
CHOICES="$(
cat <<EOF
$icon_cls Close Menu
$(_movetowssubmenu)
$icon_rld Shift stack
$icon_grd Toggle Layout
$icon_trh Kill window
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$WMINDEX" -p "WM Menu")"
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
?" Move to WS "?)
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
;;
"$icon_rld Shift stack")
sxmo_wm.sh switchfocus
;;
"$icon_grd Toggle Layout")
sxmo_wm.sh togglelayout
;;
"$icon_trh Kill window")
sxmo_killwindow.sh
;;
esac
done
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -I "$WMINDEX" -p "WM Menu")"
WMINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
?" Move to WS "?)
sxmo_wm.sh moveworkspace "${PICKED%" Move to WS "?}"
;;
"$icon_rld Shift stack")
sxmo_wm.sh switchfocus
;;
"$icon_grd Toggle Layout")
sxmo_wm.sh togglelayout
;;
"$icon_trh Kill window")
sxmo_killwindow.sh
;;
esac
done
}
i3windowswitcher() {
SWITCHINDEX=0
while : ; do
FORMAT='"W:" + .workspace + " | " + .app_id + " - " + .name + " (" + .id + ")"'
WINDOWSLIST="$(
i3-msg -t get_tree |
jq -r ".nodes[]
| {output: .name, content: .nodes[]}
| {output: .output, workspace: .content.name, apps: .content
| ..
| {id: .id?|tostring, name: .name?, app_id: .app_id?, shell: .shell?}
| select(.app_id != null or .shell != null)}
| {output: .output, workspace: .workspace,
id: .apps.id, app_id: .apps.app_id, name: .apps.name }
| $FORMAT
| tostring
"
)"
# Get the container ID from the node tree
CHOICES="$(
cat <<EOF
$icon_cls Close Menu
$icon_arl Previous Workspace
$icon_arr Next Workspace
$WINDOWSLIST
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
"$icon_arr Next Workspace")
sxmo_wm.sh nextworkspace
;;
"$icon_arl Previous Workspace")
sxmo_wm.sh previousworkspace
;;
*)
# Requires the actual `id` to be at the end and between parentheses
CON_ID=${PICKED##*(}
CON_ID=${CON_ID%)}
i3-msg "[con_id=$CON_ID]" focus
;;
esac
done
}
swaywindowswitcher() {
SWITCHINDEX=0
while : ; do
FORMAT='"W:" + .workspace + " | " + .app_id + " - " + .name + " (" + .id + ")"'
WINDOWSLIST="$(
swaymsg -t get_tree |
jq -r ".nodes[]
| {output: .name, content: .nodes[]}
| {output: .output, workspace: .content.name, apps: .content
| ..
| {id: .id?|tostring, name: .name?, app_id: .app_id?, shell: .shell?}
| select(.app_id != null or .shell != null)}
| {output: .output, workspace: .workspace,
id: .apps.id, app_id: .apps.app_id, name: .apps.name }
| $FORMAT
| tostring
"
)"
# Get the container ID from the node tree
CHOICES="$(
cat <<EOF
$icon_cls Close Menu
$icon_arl Previous Workspace
$icon_arr Next Workspace
$WINDOWSLIST
EOF
)"
PICKED="$(printf "%s" "$CHOICES" | dmenu -p "Switch menu" -I "$SWITCHINDEX")"
SWITCHINDEX="$(($(printf "%s" "$CHOICES" | grep -nm1 "^$PICKED$" | cut -d: -f1) -1))"
case "$PICKED" in
""|"$icon_cls Close Menu")
return
;;
"$icon_arr Next Workspace")
sxmo_wm.sh nextworkspace
;;
"$icon_arl Previous Workspace")
sxmo_wm.sh previousworkspace
;;
*)
# Requires the actual `id` to be at the end and between parentheses
CON_ID=${PICKED##*(}
CON_ID=${CON_ID%)}
swaymsg "[con_id=$CON_ID]" focus
;;
esac
done
}
if [ -n "$1" ]; then
"$SXMO_WM$1"
exit
fi
case "$SXMO_WM" in
dwm|i3) dwmwmmenu ;;
sway) swaywmmenu ;;
river) riverwmmenu ;;
esac
dwmwmmenu
+135
View File
@@ -0,0 +1,135 @@
#!/bin/sh
# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
setup_log() {
logfile=${XDG_STATE_HOME:-~/.local/state}/tinydm.log
mkdir -p "$(dirname "$logfile")"
if [ -f "$logfile" ]; then
# keep previous log file around
mv "$logfile" "$logfile".old
fi
exec >"$logfile" 2>&1
}
source_profile() {
for profile in /etc/profile "$HOME"/.profile; do
if [ -f "$profile" ]; then
# shellcheck disable=SC1090
. "$profile"
fi
done
}
# $1: session type (i.e. 'wayland', or 'x11')
source_session_profiles() {
session_type="$1"
if [ "$session_type" != "wayland" ] && [ "$session_type" != "x11" ]; then
echo "Unknown session type: $session_type"
exit 1
fi
for file in "/usr/share/tinydm/env-${session_type}.d/"*; do
if ! [ -e "$file" ]; then
continue
fi
echo "tinydm: sourcing file: $file"
# shellcheck disable=SC1090
. "$file"
done
# Source /etc dirs after /usr/share to override options properly
for file in "/etc/tinydm.d/env-${session_type}.d/"*; do
if ! [ -e "$file" ]; then
continue
fi
echo "tinydm: sourcing file: $file"
# shellcheck disable=SC1090
. "$file"
done
}
# $1: file
# $2: key
parse_xdg_desktop() {
grep "^$2=" "$1" | cut -d "=" -f 2- | tr ';' ':' | sed 's/:$//'
}
# $1: Exec line from .desktop file
run_session_wayland() {
export XDG_SESSION_TYPE=wayland
exec setpriv --ambient-caps '-all' "$@"
}
# $1: Exec line from .desktop file
run_session_x() {
export XDG_SESSION_TYPE=X11
cmd_startx="startx $(command -v "$1")"
shift
for arg in "$@"; do
cmd_startx="$cmd_startx $arg"
done
cmd_startx="$cmd_startx -- -nocursor -nolisten tcp vt1 -keeptty"
# shellcheck disable=SC2086
exec setpriv --ambient-caps '-all' $cmd_startx
}
run_session() {
target="/var/lib/tinydm/default-session.desktop"
if ! [ -e "$target" ]; then
echo "ERROR: no session configured!"
exit 1
fi
resolved="$(realpath "$target")"
desktop="$(basename "$resolved" | sed 's/\.desktop$//')"
export XDG_SESSION_DESKTOP="$desktop"
cmd="$(parse_xdg_desktop "$resolved" "Exec")"
desktop_names="$(parse_xdg_desktop "$resolved" "DesktopNames")"
if [ -n "$desktop_names" ]; then
export XDG_CURRENT_DESKTOP="$desktop_names"
fi
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] &&
[ "$TINYDM_START_DBUS_SESSION" = "true" ] &&
[ "$(command -v dbus-launch)" ]; then
cmd="$(command -v dbus-launch) --exit-with-x11 $cmd"
fi
echo "--- tinydm ---"
echo "Date: $(date)"
echo "Session: $resolved"
echo "Desktop: $desktop"
echo "Exec: $cmd"
echo "---"
case "$resolved" in
/usr/share/wayland-sessions*)
source_session_profiles wayland
# shellcheck disable=SC2086
run_session_wayland $cmd
;;
/usr/share/xsessions*)
source_session_profiles x11
# shellcheck disable=SC2086
run_session_x $cmd
;;
*)
echo "ERROR: could not detect session type!"
exit 1
;;
esac
}
setup_log
source_profile
run_session
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+885
View File
@@ -0,0 +1,885 @@
# Registry of protocol names used by X Server
# This will eventually be replaced by server-side XCB
#
# Format is Xnnn <extension-name>:<object-name>
# R=Request, V=Event, E=Error
#
# This is a security-sensitive file, please set permissions as appropriate.
#
R000 Apple-DRI:QueryVersion
R001 Apple-DRI:QueryDirectRenderingCapable
R002 Apple-DRI:CreateSurface
R003 Apple-DRI:DestroySurface
R004 Apple-DRI:AuthConnection
V000 Apple-DRI:ObsoleteEvent1
V001 Apple-DRI:ObsoleteEvent2
V002 Apple-DRI:ObsoleteEvent3
V003 Apple-DRI:SurfaceNotify
E000 Apple-DRI:ClientNotLocal
E001 Apple-DRI:OperationNotSupported
R000 Apple-WM:QueryVersion
R001 Apple-WM:FrameGetRect
R002 Apple-WM:FrameHitTest
R003 Apple-WM:FrameDraw
R004 Apple-WM:DisableUpdate
R005 Apple-WM:ReenableUpdate
R006 Apple-WM:SelectInput
R007 Apple-WM:SetWindowMenuCheck
R008 Apple-WM:SetFrontProcess
R009 Apple-WM:SetWindowLevel
R010 Apple-WM:SetCanQuit
R011 Apple-WM:SetWindowMenu
V000 Apple-WM:ControllerNotify
V001 Apple-WM:ActivationNotify
V002 Apple-WM:PasteboardNotify
E000 Apple-WM:ClientNotLocal
E001 Apple-WM:OperationNotSupported
R000 BIG-REQUESTS:Enable
R000 Composite:CompositeQueryVersion
R001 Composite:CompositeRedirectWindow
R002 Composite:CompositeRedirectSubwindows
R003 Composite:CompositeUnredirectWindow
R004 Composite:CompositeUnredirectSubwindows
R005 Composite:CompositeCreateRegionFromBorderClip
R006 Composite:CompositeNameWindowPixmap
R007 Composite:CompositeGetOverlayWindow
R008 Composite:CompositeReleaseOverlayWindow
R000 DAMAGE:QueryVersion
R001 DAMAGE:Create
R002 DAMAGE:Destroy
R003 DAMAGE:Subtract
R004 DAMAGE:Add
V000 DAMAGE:Notify
E000 DAMAGE:BadDamage
R000 DOUBLE-BUFFER:GetVersion
R001 DOUBLE-BUFFER:AllocateBackBufferName
R002 DOUBLE-BUFFER:DeallocateBackBufferName
R003 DOUBLE-BUFFER:SwapBuffers
R004 DOUBLE-BUFFER:BeginIdiom
R005 DOUBLE-BUFFER:EndIdiom
R006 DOUBLE-BUFFER:GetVisualInfo
R007 DOUBLE-BUFFER:GetBackBufferAttributes
E000 DOUBLE-BUFFER:BadBuffer
R000 DPMS:GetVersion
R001 DPMS:Capable
R002 DPMS:GetTimeouts
R003 DPMS:SetTimeouts
R004 DPMS:Enable
R005 DPMS:Disable
R006 DPMS:ForceLevel
R007 DPMS:Info
R000 DRI2:QueryVersion
R001 DRI2:Connect
R002 DRI2:Authenticate
R003 DRI2:CreateDrawable
R004 DRI2:DestroyDrawable
R005 DRI2:GetBuffers
R006 DRI2:CopyRegion
R007 DRI2:GetBuffersWithFormat
R008 DRI2:SwapBuffers
R009 DRI2:GetMSC
R010 DRI2:WaitMSC
R011 DRI2:WaitSBC
R012 DRI2:SwapInterval
V000 DRI2:BufferSwapComplete
V001 DRI2:InvalidateBuffers
R000 DRI3:QueryVersion
R001 DRI3:Open
R002 DRI3:PixmapFromBuffer
R003 DRI3:BufferFromPixmap
R004 DRI3:FenceFromFD
R005 DRI3:FDFromFence
R000 Extended-Visual-Information:QueryVersion
R001 Extended-Visual-Information:GetVisualInfo
R000 FontCache:QueryVersion
R001 FontCache:GetCacheSettings
R002 FontCache:ChangeCacheSettings
R003 FontCache:GetCacheStatistics
E000 FontCache:BadProtocol
E001 FontCache:CannotAllocMemory
R001 GLX:
R002 GLX:Large
R003 GLX:CreateContext
R004 GLX:DestroyContext
R005 GLX:MakeCurrent
R006 GLX:IsDirect
R007 GLX:QueryVersion
R008 GLX:WaitGL
R009 GLX:WaitX
R010 GLX:CopyContext
R011 GLX:SwapBuffers
R012 GLX:UseXFont
R013 GLX:CreateGLXPixmap
R014 GLX:GetVisualConfigs
R015 GLX:DestroyGLXPixmap
R016 GLX:VendorPrivate
R017 GLX:VendorPrivateWithReply
R018 GLX:QueryExtensionsString
R019 GLX:QueryServerString
R020 GLX:ClientInfo
R021 GLX:GetFBConfigs
R022 GLX:CreatePixmap
R023 GLX:DestroyPixmap
R024 GLX:CreateNewContext
R025 GLX:QueryContext
R026 GLX:MakeContextCurrent
R027 GLX:CreatePbuffer
R028 GLX:DestroyPbuffer
R029 GLX:GetDrawableAttributes
R030 GLX:ChangeDrawableAttributes
R031 GLX:CreateWindow
R032 GLX:DeleteWindow
R033 GLX:SetClientInfoARB
R034 GLX:CreateContextAttribsARB
R035 GLX:SetClientInfo2ARB
R101 GLX:NewList
R102 GLX:EndList
R103 GLX:DeleteLists
R104 GLX:GenLists
R105 GLX:FeedbackBuffer
R106 GLX:SelectBuffer
R107 GLX:Mode
R108 GLX:Finish
R109 GLX:PixelStoref
R110 GLX:PixelStorei
R111 GLX:ReadPixels
R112 GLX:GetBooleanv
R113 GLX:GetClipPlane
R114 GLX:GetDoublev
R115 GLX:GetError
R116 GLX:GetFloatv
R117 GLX:GetIntegerv
R118 GLX:GetLightfv
R119 GLX:GetLightiv
R120 GLX:GetMapdv
R121 GLX:GetMapfv
R122 GLX:GetMapiv
R123 GLX:GetMaterialfv
R124 GLX:GetMaterialiv
R125 GLX:GetPixelfv
R126 GLX:GetPixelMapuiv
R127 GLX:GetPixelMapusv
R128 GLX:GetPolygonStipple
R129 GLX:GetString
R130 GLX:GetTexEnvfv
R131 GLX:GetTexEnviv
R132 GLX:GetTexGendv
R133 GLX:GetTexGenfv
R134 GLX:GetTexGeniv
R135 GLX:GetTexImage
R136 GLX:GetTexParameterfv
R137 GLX:GetTexParameteriv
R138 GLX:GetTexLevelParameterfv
R139 GLX:GetTexLevelParameteriv
R140 GLX:IsEnabled
R141 GLX:IsList
R142 GLX:Flush
R143 GLX:AreTexturesResident
R144 GLX:DeleteTextures
R145 GLX:GenTextures
R146 GLX:IsTexture
R147 GLX:GetColorTable
R148 GLX:GetColorTableParameterfv
R149 GLX:GetColorTableParameterfv
R150 GLX:GetConvolutionFilter
R151 GLX:GetConvolutionParameterfv
R152 GLX:GetConvolutionParameteriv
R153 GLX:GetSeparableFilter
R154 GLX:GetHistogram
R155 GLX:GetHistogramParameterfv
R156 GLX:GetHistogramParameteriv
R157 GLX:GetMinmax
R158 GLX:GetMinmaxParameterfv
R159 GLX:GetMinmaxParameteriv
R160 GLX:GetCompressedTexImage
V000 GLX:PbufferClobber
V001 GLX:BufferSwapComplete
E000 GLX:BadContext
E001 GLX:BadContextState
E002 GLX:BadDrawable
E003 GLX:BadPixmap
E004 GLX:BadContextTag
E005 GLX:BadCurrentWindow
E006 GLX:BadRenderRequest
E007 GLX:BadLargeRequest
E008 GLX:UnsupportedPrivateRequest
E009 GLX:BadFBConfig
E010 GLX:BadPbuffer
E011 GLX:BadCurrentDrawable
E012 GLX:BadWindow
R000 MIT-SCREEN-SAVER:QueryVersion
R001 MIT-SCREEN-SAVER:QueryInfo
R002 MIT-SCREEN-SAVER:SelectInput
R003 MIT-SCREEN-SAVER:SetAttributes
R004 MIT-SCREEN-SAVER:UnsetAttributes
R005 MIT-SCREEN-SAVER:Suspend
V000 MIT-SCREEN-SAVER:Notify
R000 MIT-SHM:QueryVersion
R001 MIT-SHM:Attach
R002 MIT-SHM:Detach
R003 MIT-SHM:PutImage
R004 MIT-SHM:GetImage
R005 MIT-SHM:CreatePixmap
R006 MIT-SHM:AttachFd
R007 MIT-SHM:CreateSegment
V000 MIT-SHM:Completion
E000 MIT-SHM:BadShmSeg
R000 MIT-SUNDRY-NONSTANDARD:SetBugMode
R001 MIT-SUNDRY-NONSTANDARD:GetBugMode
R000 Present:QueryVersion
R001 Present:Pixmap
R002 Present:NotifyMSC
R003 Present:SelectInput
R004 Present:QueryCapabilities
R000 RANDR:QueryVersion
R001 RANDR:OldGetScreenInfo
R002 RANDR:SetScreenConfig
R003 RANDR:OldScreenChangeSelectInput
R004 RANDR:SelectInput
R005 RANDR:GetScreenInfo
R006 RANDR:GetScreenSizeRange
R007 RANDR:SetScreenSize
R008 RANDR:GetScreenResources
R009 RANDR:GetOutputInfo
R010 RANDR:ListOutputProperties
R011 RANDR:QueryOutputProperty
R012 RANDR:ConfigureOutputProperty
R013 RANDR:ChangeOutputProperty
R014 RANDR:DeleteOutputProperty
R015 RANDR:GetOutputProperty
R016 RANDR:CreateMode
R017 RANDR:DestroyMode
R018 RANDR:AddOutputMode
R019 RANDR:DeleteOutputMode
R020 RANDR:GetCrtcInfo
R021 RANDR:SetCrtcConfig
R022 RANDR:GetCrtcGammaSize
R023 RANDR:GetCrtcGamma
R024 RANDR:SetCrtcGamma
R025 RANDR:GetScreenResourcesCurrent
R026 RANDR:SetCrtcTransform
R027 RANDR:GetCrtcTransform
R028 RANDR:GetPanning
R029 RANDR:SetPanning
R030 RANDR:SetOutputPrimary
R031 RANDR:GetOutputPrimary
R032 RANDR:RRGetProviders
R033 RANDR:RRGetProviderInfo
R034 RANDR:RRSetProviderOffloadSink
R035 RANDR:RRSetProviderOutputSource
R036 RANDR:RRListProviderProperties
R037 RANDR:RRQueryProviderProperty
R038 RANDR:RRConfigureProviderProperty
R039 RANDR:RRChangeProviderProperty
R040 RANDR:RRDeleteProviderProperty
R041 RANDR:RRGetProviderProperty
R042 RANDR:GetMonitors
R043 RANDR:SetMonitor
R044 RANDR:DeleteMonitor
V000 RANDR:ScreenChangeNotify
V001 RANDR:Notify
E000 RANDR:BadRROutput
E001 RANDR:BadRRCrtc
E002 RANDR:BadRRMode
E003 RANDR:BadRRProvider
R000 RECORD:QueryVersion
R001 RECORD:CreateContext
R002 RECORD:RegisterClients
R003 RECORD:UnregisterClients
R004 RECORD:GetContext
R005 RECORD:EnableContext
R006 RECORD:DisableContext
R007 RECORD:FreeContext
E000 RECORD:BadContext
R000 RENDER:QueryVersion
R001 RENDER:QueryPictFormats
R002 RENDER:QueryPictIndexValues
R003 RENDER:QueryDithers
R004 RENDER:CreatePicture
R005 RENDER:ChangePicture
R006 RENDER:SetPictureClipRectangles
R007 RENDER:FreePicture
R008 RENDER:Composite
R009 RENDER:Scale
R010 RENDER:Trapezoids
R011 RENDER:Triangles
R012 RENDER:TriStrip
R013 RENDER:TriFan
R014 RENDER:ColorTrapezoids
R015 RENDER:ColorTriangles
R016 RENDER:Transform
R017 RENDER:CreateGlyphSet
R018 RENDER:ReferenceGlyphSet
R019 RENDER:FreeGlyphSet
R020 RENDER:AddGlyphs
R021 RENDER:AddGlyphsFromPicture
R022 RENDER:FreeGlyphs
R023 RENDER:CompositeGlyphs8
R024 RENDER:CompositeGlyphs16
R025 RENDER:CompositeGlyphs32
R026 RENDER:FillRectangles
R027 RENDER:CreateCursor
R028 RENDER:SetPictureTransform
R029 RENDER:QueryFilters
R030 RENDER:SetPictureFilter
R031 RENDER:CreateAnimCursor
R032 RENDER:AddTraps
R033 RENDER:CreateSolidFill
R034 RENDER:CreateLinearGradient
R035 RENDER:CreateRadialGradient
R036 RENDER:CreateConicalGradient
E000 RENDER:BadPictFormat
E001 RENDER:BadPicture
E002 RENDER:BadPictOp
E003 RENDER:BadGlyphSet
E004 RENDER:BadGlyph
R000 SECURITY:QueryVersion
R001 SECURITY:GenerateAuthorization
R002 SECURITY:RevokeAuthorization
V000 SECURITY:AuthorizationRevoked
E000 SECURITY:BadAuthorization
E001 SECURITY:BadAuthorizationProtocol
R000 SELinux:SELinuxQueryVersion
R001 SELinux:SELinuxSetDeviceCreateContext
R002 SELinux:SELinuxGetDeviceCreateContext
R003 SELinux:SELinuxSetDeviceContext
R004 SELinux:SELinuxGetDeviceContext
R005 SELinux:SELinuxSetWindowCreateContext
R006 SELinux:SELinuxGetWindowCreateContext
R007 SELinux:SELinuxGetWindowContext
R008 SELinux:SELinuxSetPropertyCreateContext
R009 SELinux:SELinuxGetPropertyCreateContext
R010 SELinux:SELinuxSetPropertyUseContext
R011 SELinux:SELinuxGetPropertyUseContext
R012 SELinux:SELinuxGetPropertyContext
R013 SELinux:SELinuxGetPropertyDataContext
R014 SELinux:SELinuxListProperties
R015 SELinux:SELinuxSetSelectionCreateContext
R016 SELinux:SELinuxGetSelectionCreateContext
R017 SELinux:SELinuxSetSelectionUseContext
R018 SELinux:SELinuxGetSelectionUseContext
R019 SELinux:SELinuxGetSelectionContext
R020 SELinux:SELinuxGetSelectionDataContext
R021 SELinux:SELinuxListSelections
R022 SELinux:SELinuxGetClientContext
R000 SHAPE:QueryVersion
R001 SHAPE:Rectangles
R002 SHAPE:Mask
R003 SHAPE:Combine
R004 SHAPE:Offset
R005 SHAPE:QueryExtents
R006 SHAPE:SelectInput
R007 SHAPE:InputSelected
R008 SHAPE:GetRectangles
V000 SHAPE:Notify
R000 SYNC:Initialize
R001 SYNC:ListSystemCounters
R002 SYNC:CreateCounter
R003 SYNC:SetCounter
R004 SYNC:ChangeCounter
R005 SYNC:QueryCounter
R006 SYNC:DestroyCounter
R007 SYNC:Await
R008 SYNC:CreateAlarm
R009 SYNC:ChangeAlarm
R010 SYNC:QueryAlarm
R011 SYNC:DestroyAlarm
R012 SYNC:SetPriority
R013 SYNC:GetPriority
V000 SYNC:CounterNotify
V001 SYNC:AlarmNotify
E000 SYNC:BadCounter
E001 SYNC:BadAlarm
R000 TOG-CUP:QueryVersion
R001 TOG-CUP:GetReservedColormapEntries
R002 TOG-CUP:StoreColors
R000 Windows-WM:QueryVersion
R001 Windows-WM:FrameGetRect
R002 Windows-WM:FrameDraw
R003 Windows-WM:FrameSetTitle
R004 Windows-WM:DisableUpdate
R005 Windows-WM:ReenableUpdate
R006 Windows-WM:SelectInput
R007 Windows-WM:SetFrontProcess
V000 Windows-WM:ControllerNotify
V001 Windows-WM:ActivationNotify
E000 Windows-WM:ClientNotLocal
E001 Windows-WM:OperationNotSupported
R000 X-Resource:QueryVersion
R001 X-Resource:QueryClients
R002 X-Resource:QueryClientResources
R003 X-Resource:QueryClientPixmapBytes
R001 X11:CreateWindow
R002 X11:ChangeWindowAttributes
R003 X11:GetWindowAttributes
R004 X11:DestroyWindow
R005 X11:DestroySubwindows
R006 X11:ChangeSaveSet
R007 X11:ReparentWindow
R008 X11:MapWindow
R009 X11:MapSubwindows
R010 X11:UnmapWindow
R011 X11:UnmapSubwindows
R012 X11:ConfigureWindow
R013 X11:CirculateWindow
R014 X11:GetGeometry
R015 X11:QueryTree
R016 X11:InternAtom
R017 X11:GetAtomName
R018 X11:ChangeProperty
R019 X11:DeleteProperty
R020 X11:GetProperty
R021 X11:ListProperties
R022 X11:SetSelectionOwner
R023 X11:GetSelectionOwner
R024 X11:ConvertSelection
R025 X11:SendEvent
R026 X11:GrabPointer
R027 X11:UngrabPointer
R028 X11:GrabButton
R029 X11:UngrabButton
R030 X11:ChangeActivePointerGrab
R031 X11:GrabKeyboard
R032 X11:UngrabKeyboard
R033 X11:GrabKey
R034 X11:UngrabKey
R035 X11:AllowEvents
R036 X11:GrabServer
R037 X11:UngrabServer
R038 X11:QueryPointer
R039 X11:GetMotionEvents
R040 X11:TranslateCoords
R041 X11:WarpPointer
R042 X11:SetInputFocus
R043 X11:GetInputFocus
R044 X11:QueryKeymap
R045 X11:OpenFont
R046 X11:CloseFont
R047 X11:QueryFont
R048 X11:QueryTextExtents
R049 X11:ListFonts
R050 X11:ListFontsWithInfo
R051 X11:SetFontPath
R052 X11:GetFontPath
R053 X11:CreatePixmap
R054 X11:FreePixmap
R055 X11:CreateGC
R056 X11:ChangeGC
R057 X11:CopyGC
R058 X11:SetDashes
R059 X11:SetClipRectangles
R060 X11:FreeGC
R061 X11:ClearArea
R062 X11:CopyArea
R063 X11:CopyPlane
R064 X11:PolyPoint
R065 X11:PolyLine
R066 X11:PolySegment
R067 X11:PolyRectangle
R068 X11:PolyArc
R069 X11:FillPoly
R070 X11:PolyFillRectangle
R071 X11:PolyFillArc
R072 X11:PutImage
R073 X11:GetImage
R074 X11:PolyText8
R075 X11:PolyText16
R076 X11:ImageText8
R077 X11:ImageText16
R078 X11:CreateColormap
R079 X11:FreeColormap
R080 X11:CopyColormapAndFree
R081 X11:InstallColormap
R082 X11:UninstallColormap
R083 X11:ListInstalledColormaps
R084 X11:AllocColor
R085 X11:AllocNamedColor
R086 X11:AllocColorCells
R087 X11:AllocColorPlanes
R088 X11:FreeColors
R089 X11:StoreColors
R090 X11:StoreNamedColor
R091 X11:QueryColors
R092 X11:LookupColor
R093 X11:CreateCursor
R094 X11:CreateGlyphCursor
R095 X11:FreeCursor
R096 X11:RecolorCursor
R097 X11:QueryBestSize
R098 X11:QueryExtension
R099 X11:ListExtensions
R100 X11:ChangeKeyboardMapping
R101 X11:GetKeyboardMapping
R102 X11:ChangeKeyboardControl
R103 X11:GetKeyboardControl
R104 X11:Bell
R105 X11:ChangePointerControl
R106 X11:GetPointerControl
R107 X11:SetScreenSaver
R108 X11:GetScreenSaver
R109 X11:ChangeHosts
R110 X11:ListHosts
R111 X11:SetAccessControl
R112 X11:SetCloseDownMode
R113 X11:KillClient
R114 X11:RotateProperties
R115 X11:ForceScreenSaver
R116 X11:SetPointerMapping
R117 X11:GetPointerMapping
R118 X11:SetModifierMapping
R119 X11:GetModifierMapping
R127 X11:NoOperation
V000 X11:X_Error
V001 X11:X_Reply
V002 X11:KeyPress
V003 X11:KeyRelease
V004 X11:ButtonPress
V005 X11:ButtonRelease
V006 X11:MotionNotify
V007 X11:EnterNotify
V008 X11:LeaveNotify
V009 X11:FocusIn
V010 X11:FocusOut
V011 X11:KeymapNotify
V012 X11:Expose
V013 X11:GraphicsExpose
V014 X11:NoExpose
V015 X11:VisibilityNotify
V016 X11:CreateNotify
V017 X11:DestroyNotify
V018 X11:UnmapNotify
V019 X11:MapNotify
V020 X11:MapRequest
V021 X11:ReparentNotify
V022 X11:ConfigureNotify
V023 X11:ConfigureRequest
V024 X11:GravityNotify
V025 X11:ResizeRequest
V026 X11:CirculateNotify
V027 X11:CirculateRequest
V028 X11:PropertyNotify
V029 X11:SelectionClear
V030 X11:SelectionRequest
V031 X11:SelectionNotify
V032 X11:ColormapNotify
V033 X11:ClientMessage
V034 X11:MappingNotify
V035 X11:GenericEvent
E000 X11:Success
E001 X11:BadRequest
E002 X11:BadValue
E003 X11:BadWindow
E004 X11:BadPixmap
E005 X11:BadAtom
E006 X11:BadCursor
E007 X11:BadFont
E008 X11:BadMatch
E009 X11:BadDrawable
E010 X11:BadAccess
E011 X11:BadAlloc
E012 X11:BadColor
E013 X11:BadGC
E014 X11:BadIDChoice
E015 X11:BadName
E016 X11:BadLength
E017 X11:BadImplementation
R000 XC-APPGROUP:QueryVersion
R001 XC-APPGROUP:Create
R002 XC-APPGROUP:Destroy
R003 XC-APPGROUP:GetAttr
R004 XC-APPGROUP:Query
R005 XC-APPGROUP:CreateAssoc
R006 XC-APPGROUP:DestroyAssoc
E000 XC-APPGROUP:BadAppGroup
R000 XC-MISC:GetVersion
R001 XC-MISC:GetXIDRange
R002 XC-MISC:GetXIDList
R000 XFIXES:QueryVersion
R001 XFIXES:ChangeSaveSet
R002 XFIXES:SelectSelectionInput
R003 XFIXES:SelectCursorInput
R004 XFIXES:GetCursorImage
R005 XFIXES:CreateRegion
R006 XFIXES:CreateRegionFromBitmap
R007 XFIXES:CreateRegionFromWindow
R008 XFIXES:CreateRegionFromGC
R009 XFIXES:CreateRegionFromPicture
R010 XFIXES:DestroyRegion
R011 XFIXES:SetRegion
R012 XFIXES:CopyRegion
R013 XFIXES:UnionRegion
R014 XFIXES:IntersectRegion
R015 XFIXES:SubtractRegion
R016 XFIXES:InvertRegion
R017 XFIXES:TranslateRegion
R018 XFIXES:RegionExtents
R019 XFIXES:FetchRegion
R020 XFIXES:SetGCClipRegion
R021 XFIXES:SetWindowShapeRegion
R022 XFIXES:SetPictureClipRegion
R023 XFIXES:SetCursorName
R024 XFIXES:GetCursorName
R025 XFIXES:GetCursorImageAndName
R026 XFIXES:ChangeCursor
R027 XFIXES:ChangeCursorByName
R028 XFIXES:ExpandRegion
R029 XFIXES:HideCursor
R030 XFIXES:ShowCursor
V000 XFIXES:SelectionNotify
V001 XFIXES:CursorNotify
E000 XFIXES:BadRegion
R000 XFree86-DGA:QueryVersion
R001 XFree86-DGA:GetVideoLL
R002 XFree86-DGA:DirectVideo
R003 XFree86-DGA:GetViewPortSize
R004 XFree86-DGA:SetViewPort
R005 XFree86-DGA:GetVidPage
R006 XFree86-DGA:SetVidPage
R007 XFree86-DGA:InstallColormap
R008 XFree86-DGA:QueryDirectVideo
R009 XFree86-DGA:ViewPortChanged
R010 XFree86-DGA:Obsolete1
R011 XFree86-DGA:Obsolete2
R012 XFree86-DGA:QueryModes
R013 XFree86-DGA:SetMode
R014 XFree86-DGA:SetViewport
R015 XFree86-DGA:InstallColormap
R016 XFree86-DGA:SelectInput
R017 XFree86-DGA:FillRectangle
R018 XFree86-DGA:CopyArea
R019 XFree86-DGA:CopyTransparentArea
R020 XFree86-DGA:GetViewportStatus
R021 XFree86-DGA:Sync
R022 XFree86-DGA:OpenFramebuffer
R023 XFree86-DGA:CloseFramebuffer
R024 XFree86-DGA:SetClientVersion
R025 XFree86-DGA:ChangePixmapMode
R026 XFree86-DGA:CreateColormap
E000 XFree86-DGA:ClientNotLocal
E001 XFree86-DGA:NoDirectVideoMode
E002 XFree86-DGA:ScreenNotActive
E003 XFree86-DGA:DirectNotActivated
E004 XFree86-DGA:OperationNotSupported
R000 XFree86-DRI:QueryVersion
R001 XFree86-DRI:QueryDirectRenderingCapable
R002 XFree86-DRI:OpenConnection
R003 XFree86-DRI:CloseConnection
R004 XFree86-DRI:GetClientDriverName
R005 XFree86-DRI:CreateContext
R006 XFree86-DRI:DestroyContext
R007 XFree86-DRI:CreateDrawable
R008 XFree86-DRI:DestroyDrawable
R009 XFree86-DRI:GetDrawableInfo
R010 XFree86-DRI:GetDeviceInfo
R011 XFree86-DRI:AuthConnection
R012 XFree86-DRI:OpenFullScreen
R013 XFree86-DRI:CloseFullScreen
E000 XFree86-DRI:ClientNotLocal
E001 XFree86-DRI:OperationNotSupported
R000 XFree86-Misc:QueryVersion
R001 XFree86-Misc:GetSaver
R002 XFree86-Misc:SetSaver
R003 XFree86-Misc:GetMouseSettings
R004 XFree86-Misc:GetKbdSettings
R005 XFree86-Misc:SetMouseSettings
R006 XFree86-Misc:SetKbdSettings
R007 XFree86-Misc:SetGrabKeysState
R008 XFree86-Misc:SetClientVersion
R009 XFree86-Misc:GetFilePaths
R010 XFree86-Misc:PassMessage
E000 XFree86-Misc:BadMouseProtocol
E001 XFree86-Misc:BadMouseBaudRate
E002 XFree86-Misc:BadMouseFlags
E003 XFree86-Misc:BadMouseCombo
E004 XFree86-Misc:BadKbdType
E005 XFree86-Misc:ModInDevDisabled
E006 XFree86-Misc:ModInDevClientNotLocal
E007 XFree86-Misc:NoModule
R000 XFree86-VidModeExtension:QueryVersion
R001 XFree86-VidModeExtension:GetModeLine
R002 XFree86-VidModeExtension:ModModeLine
R003 XFree86-VidModeExtension:SwitchMode
R004 XFree86-VidModeExtension:GetMonitor
R005 XFree86-VidModeExtension:LockModeSwitch
R006 XFree86-VidModeExtension:GetAllModeLines
R007 XFree86-VidModeExtension:AddModeLine
R008 XFree86-VidModeExtension:DeleteModeLine
R009 XFree86-VidModeExtension:ValidateModeLine
R010 XFree86-VidModeExtension:SwitchToMode
R011 XFree86-VidModeExtension:GetViewPort
R012 XFree86-VidModeExtension:SetViewPort
R013 XFree86-VidModeExtension:GetDotClocks
R014 XFree86-VidModeExtension:SetClientVersion
R015 XFree86-VidModeExtension:SetGamma
R016 XFree86-VidModeExtension:GetGamma
R017 XFree86-VidModeExtension:GetGammaRamp
R018 XFree86-VidModeExtension:SetGammaRamp
R019 XFree86-VidModeExtension:GetGammaRampSize
R020 XFree86-VidModeExtension:GetPermissions
V000 XFree86-VidModeExtension:Notify
E000 XFree86-VidModeExtension:BadClock
E001 XFree86-VidModeExtension:BadHTimings
E002 XFree86-VidModeExtension:BadVTimings
E003 XFree86-VidModeExtension:ModeUnsuitable
E004 XFree86-VidModeExtension:ExtensionDisabled
E005 XFree86-VidModeExtension:ClientNotLocal
E006 XFree86-VidModeExtension:ZoomLocked
R000 XINERAMA:QueryVersion
R001 XINERAMA:GetState
R002 XINERAMA:GetScreenCount
R003 XINERAMA:GetScreenSize
R004 XINERAMA:IsActive
R005 XINERAMA:QueryScreens
R001 XInputExtension:GetExtensionVersion
R002 XInputExtension:ListInputDevices
R003 XInputExtension:OpenDevice
R004 XInputExtension:CloseDevice
R005 XInputExtension:SetDeviceMode
R006 XInputExtension:SelectExtensionEvent
R007 XInputExtension:GetSelectedExtensionEvents
R008 XInputExtension:ChangeDeviceDontPropagateList
R009 XInputExtension:GetDeviceDontPropagageList
R010 XInputExtension:GetDeviceMotionEvents
R011 XInputExtension:ChangeKeyboardDevice
R012 XInputExtension:ChangePointerDevice
R013 XInputExtension:GrabDevice
R014 XInputExtension:UngrabDevice
R015 XInputExtension:GrabDeviceKey
R016 XInputExtension:UngrabDeviceKey
R017 XInputExtension:GrabDeviceButton
R018 XInputExtension:UngrabDeviceButton
R019 XInputExtension:AllowDeviceEvents
R020 XInputExtension:GetDeviceFocus
R021 XInputExtension:SetDeviceFocus
R022 XInputExtension:GetFeedbackControl
R023 XInputExtension:ChangeFeedbackControl
R024 XInputExtension:GetDeviceKeyMapping
R025 XInputExtension:ChangeDeviceKeyMapping
R026 XInputExtension:GetDeviceModifierMapping
R027 XInputExtension:SetDeviceModifierMapping
R028 XInputExtension:GetDeviceButtonMapping
R029 XInputExtension:SetDeviceButtonMapping
R030 XInputExtension:QueryDeviceState
R031 XInputExtension:SendExtensionEvent
R032 XInputExtension:DeviceBell
R033 XInputExtension:SetDeviceValuators
R034 XInputExtension:GetDeviceControl
R035 XInputExtension:ChangeDeviceControl
R036 XInputExtension:ListDeviceProperties
R037 XInputExtension:ChangeDeviceProperty
R038 XInputExtension:DeleteDeviceProperty
R039 XInputExtension:GetDeviceProperty
R040 XInputExtension:QueryPointer
R041 XInputExtension:WarpPointer
R042 XInputExtension:ChangeCursor
R043 XInputExtension:ChangeHierarchy
R044 XInputExtension:SetClientPointer
R045 XInputExtension:GetClientPointer
R046 XInputExtension:SelectEvents
R047 XInputExtension:QueryVersion
R048 XInputExtension:QueryDevice
R049 XInputExtension:SetFocus
R050 XInputExtension:GetFocus
R051 XInputExtension:GrabDevice
R052 XInputExtension:UngrabDevice
R053 XInputExtension:AllowEvents
R054 XInputExtension:PassiveGrabDevice
R055 XInputExtension:PassiveUngrabDevice
R056 XInputExtension:ListProperties
R057 XInputExtension:ChangeProperty
R058 XInputExtension:DeleteProperty
R059 XInputExtension:GetProperty
R060 XInputExtension:GetSelectedEvents
V000 XInputExtension:DeviceValuator
V001 XInputExtension:DeviceKeyPress
V002 XInputExtension:DeviceKeyRelease
V003 XInputExtension:DeviceButtonPress
V004 XInputExtension:DeviceButtonRelease
V005 XInputExtension:DeviceMotionNotify
V006 XInputExtension:DeviceFocusIn
V007 XInputExtension:DeviceFocusOut
V008 XInputExtension:ProximityIn
V009 XInputExtension:ProximityOut
V010 XInputExtension:DeviceStateNotify
V011 XInputExtension:DeviceMappingNotify
V012 XInputExtension:ChangeDeviceNotify
V013 XInputExtension:DeviceKeystateNotify
V014 XInputExtension:DeviceButtonstateNotify
V015 XInputExtension:DevicePresenceNotify
V016 XInputExtension:DevicePropertyNotify
E000 XInputExtension:BadDevice
E001 XInputExtension:BadEvent
E002 XInputExtension:BadMode
E003 XInputExtension:DeviceBusy
E004 XInputExtension:BadClass
R000 XKEYBOARD:UseExtension
R001 XKEYBOARD:SelectEvents
R002 XKEYBOARD:Obsolete
R003 XKEYBOARD:Bell
R004 XKEYBOARD:GetState
R005 XKEYBOARD:LatchLockState
R006 XKEYBOARD:GetControls
R007 XKEYBOARD:SetControls
R008 XKEYBOARD:GetMap
R009 XKEYBOARD:SetMap
R010 XKEYBOARD:GetCompatMap
R011 XKEYBOARD:SetCompatMap
R012 XKEYBOARD:GetIndicatorState
R013 XKEYBOARD:GetIndicatorMap
R014 XKEYBOARD:SetIndicatorMap
R015 XKEYBOARD:GetNamedIndicator
R016 XKEYBOARD:SetNamedIndicator
R017 XKEYBOARD:GetNames
R018 XKEYBOARD:SetNames
R019 XKEYBOARD:GetGeometry
R020 XKEYBOARD:SetGeometry
R021 XKEYBOARD:PerClientFlags
R022 XKEYBOARD:ListComponents
R023 XKEYBOARD:GetKbdByName
R024 XKEYBOARD:GetDeviceInfo
R025 XKEYBOARD:SetDeviceInfo
R101 XKEYBOARD:SetDebuggingFlags
V000 XKEYBOARD:EventCode
E000 XKEYBOARD:BadKeyboard
R000 XTEST:GetVersion
R001 XTEST:CompareCursor
R002 XTEST:FakeInput
R003 XTEST:GrabControl
R000 XVideo:QueryExtension
R001 XVideo:QueryAdaptors
R002 XVideo:QueryEncodings
R003 XVideo:GrabPort
R004 XVideo:UngrabPort
R005 XVideo:PutVideo
R006 XVideo:PutStill
R007 XVideo:GetVideo
R008 XVideo:GetStill
R009 XVideo:StopVideo
R010 XVideo:SelectVideoNotify
R011 XVideo:SelectPortNotify
R012 XVideo:QueryBestSize
R013 XVideo:SetPortAttribute
R014 XVideo:GetPortAttribute
R015 XVideo:QueryPortAttributes
R016 XVideo:ListImageFormats
R017 XVideo:QueryImageAttributes
R018 XVideo:PutImage
R019 XVideo:ShmPutImage
V000 XVideo:VideoNotify
V001 XVideo:PortNotify
E000 XVideo:BadPort
E001 XVideo:BadEncoding
E002 XVideo:BadControl
R000 XVideo-MotionCompensation:QueryVersion
R001 XVideo-MotionCompensation:ListSurfaceTypes
R002 XVideo-MotionCompensation:CreateContext
R003 XVideo-MotionCompensation:DestroyContext
R004 XVideo-MotionCompensation:CreateSurface
R005 XVideo-MotionCompensation:DestroySurface
R006 XVideo-MotionCompensation:CreateSubpicture
R007 XVideo-MotionCompensation:DestroySubpicture
R008 XVideo-MotionCompensation:ListSubpictureTypes
R009 XVideo-MotionCompensation:GetDRInfo
E000 XVideo-MotionCompensation:BadContext
E001 XVideo-MotionCompensation:BadSurface
E002 XVideo-MotionCompensation:BadSubpicture
@@ -0,0 +1,48 @@
# Collection of quirks and blacklist/whitelists for specific devices.
# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
Section "InputClass"
Identifier "ThinkPad HDAPS accelerometer blacklist"
MatchProduct "ThinkPad HDAPS accelerometer data"
Option "Ignore" "on"
EndSection
# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
Identifier "Xen Virtual Pointer axis blacklist"
MatchProduct "Xen Virtual Pointer"
Option "IgnoreAbsoluteAxes" "off"
Option "IgnoreRelativeAxes" "off"
EndSection
# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
Identifier "Tag trackballs as XI_TRACKBALL"
MatchProduct "trackball"
MatchDriver "evdev"
Option "TypeName" "TRACKBALL"
EndSection
# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
MatchProduct "La-VIEW Technology Naos 5000 Mouse"
MatchDriver "evdev"
Option "TypeName" "MOUSE"
EndSection
# https://bugzilla.redhat.com/show_bug.cgi?id=2152414
# Xorg server does not correctly select the DCP for the display without
# a quirk on Apple Silicon
Section "OutputClass"
Identifier "appledrm"
MatchDriver "apple"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
@@ -0,0 +1,52 @@
# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
# Identifier "something or other"
# MatchDriver "libinput"
#
# MatchIsTouchpad "on"
# ... other Match directives ...
# Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.
Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
Section "InputClass"
Identifier "libinput tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.impl.portal.PermissionStore
Exec=/bin/true
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.impl.portal.desktop.gtk
Exec=/bin/true
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.portal.Desktop
Exec=/bin/true
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.freedesktop.portal.Documents
Exec=/bin/true
@@ -0,0 +1,8 @@
polkit.addRule(function(action, subject) {
if ((action.id.indexOf("org.freedesktop.ModemManager1.") == 0 ||
action.id.indexOf("org.freedesktop.login1.") == 0 ||
action.id.indexOf("org.freedesktop.NetworkManager.") == 0) &&
(subject.isInGroup("plugdev") || subject.isInGroup("wheel"))) {
return polkit.Result.YES;
}
});
@@ -0,0 +1,23 @@
! Space to setup configversion
! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
dmenu.background: #1c1c1c
dmenu.foreground: #e0e0e0
dmenu.selbackground: #005577
dmenu.selforeground: #ffffff
dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
dwm.normbgcolor: #323232
dwm.normbordercolor: #444444
dwm.normfgcolor: #dddddd
dwm.selbgcolor: #005577
dwm.selbordercolor: #005577
dwm.selfgcolor: #ffffff
st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true
st.background: #1c1c1c
st.foreground: #e5e5e5
st.cursorColor: #cccccc
svkbd.font: Fira Code:pixelsize=12
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
out_to_x = false,
out_to_wayland = true,
output_backend = 'x11',
out_to_x = true,
out_to_wayland = false,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
double_buffer = true,
alignment = 'top_middle',
gap_y = 12,
own_window_argb_value = 0,
own_window_type = 'desktop',
gap_x = 0,
gap_y = 34,
default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
font = 'Sxmo:size=13',
font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
@@ -9,7 +9,7 @@
frame_width = 2
frame_color = "#005577"
idle_threshold = 120
font = Monospace 12
font = Fira Code 9.5
markup = full
max_icon_size = 24
dmenu = sxmo_dmenu.sh -p dunst:
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!-- configversion: c90188e736e042ebe71879799645b0c4 -->
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Sxmo</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Fira Code</family>
<family>DejaVu SansM Nerd Font</family>
<family>Dejavu Sans Mono Nerd Font</family>
</prefer>
</alias>
</fontconfig>
@@ -1,40 +0,0 @@
# Space to setup configversion
# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
font=monospace:size=13
dpi-aware=no
pad=2x2
[colors-dark]
# alpha=1.0
foreground=eaeaea
background=000000
regular0=000000 # black
regular1=d54e53 # red
regular2=b9ca4a # green
regular3=e6c547 # yellow
regular4=7aa6da # blue
regular5=c397d8 # magenta
regular6=70c0ba # cyan
regular7=eaeaea # white
bright0=666666 # bright black
bright1=ff3334 # bright red
bright2=9ec400 # bright green
bright3=e7c547 # bright yellow
bright4=7aa6da # bright blue
bright5=b77ee0 # bright magenta
bright6=54ced6 # bright cyan
bright7=ffffff # bright white
[scrollback]
lines=5000
[key-bindings]
scrollback-up-page=Shift+Page_Up
scrollback-down-page=Shift+Page_Down
scrollback-up-half-page=Page_Up
scrollback-down-half-page=Page_Down
scrollback-up-line=Shift+Up
scrollback-down-line=Shift+Down
scrollback-home=Shift+Home
scrollback-end=Shift+End
+89
View File
@@ -0,0 +1,89 @@
#!/bin/sh
# configversion: e7cdaa3a889d251bed8a89ce8c622995
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
# Please modify this file to your liking
# Important Instructions:
# All processes you launch from this script must
# be non-blocking: launch them in the background (using &)
# or ensure they return quickly. Only after this script
# finishes will the window manager be loaded
# You will sometime get SMS or calls from not
# country code prefixed phone numbers. To make
# it easy to fixup configure the default countryu.
#export DEFAULT_COUNTRY=FR
### Configuration Parameters ###
# Note that this is just a subset of all available
# parameters, see the sxmo documentation for more.
# Use firefox as default browser if installed
command -v firefox >/dev/null && export BROWSER=firefox
# Prepopulate Subreddits menu with custom subreddits
#export SXMO_SUBREDDITS="postmarketos pinephoneOfficial pinephone unixporn"
# Change the default terminal command
export TERMCMD="sxmo_terminal.sh"
# Change the used terminal command
# export SXMO_TERMINAL="st"
# When scrolling past the beginning or end of a menu, wrap it around:
#export DMENU_WRAP_AROUND=1
# Enable audio feedback on keypress
#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)"
# Or, enable vibration feedback on keypress
#export KEYBOARD_ARGS="-o | clickclack -V"
# Set the scale factor in sway
# export SXMO_SWAY_SCALE=2
# To load specific part of configuration depending on the running environment
case "$SXMO_WM" in
sway)
;;
dwm)
;;
esac
#Set RINGTONE to audio file to play for incoming call
export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)"
#Set TEXTSOUND to audio file to play when received text message
export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)"
#Set RINGTIME to number of seconds the phone will ring
export SXMO_RINGTIME=20
#Set RINGNUMBER to number of times phone will ring or repeat ringtone
#(whichever of SXMO_RINGTIME or SXMO_RINGNUMBER runs less will limit how long phone rings)
export SXMO_RINGNUMBER=10
#Set to the default text for a new text message.
export SXMO_DEFAULT_DRAFT="Enter new message here."
export PATH="$HOME/.local/bin:$PATH"
export SXMO_WM="dwm"
export SXMO_MENU="dmenu"
export SXMO_TERMINAL="st"
export DMENU_WRAP_AROUND=1
export SXMO_DMENU_PORTRAIT_LINES=12
export SXMO_DMENU_LANDSCAPE_LINES=8
export SXMO_DISABLE_LEDS=1
export SXMO_NO_VIRTUAL_KEYBOARD=1
export NO_AT_BRIDGE=1
export GTK_A11Y=none
export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
@@ -1,296 +0,0 @@
# Default config for sway
# configversion: 076611fe8cc699bcaa01092a8e4481c0
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term sxmo_terminal.sh
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu bemenu-run
font "Sxmo 13"
xwayland disable
output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
default_orientation vertical
exec_always sxmo_swayinitconf.sh
exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
mode "menu" {
bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
bindsym XF86AudioRaiseVolume exec wtype -k Up
bindsym XF86AudioLowerVolume exec wtype -k Down
bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
}
# Mode specifically for use with Nokia N900 hardware keyboard
mode "N900" {
# follow the standard sxmo keybinds as far as possible
bindsym t exec $term; mode "default"
bindsym q mode "default"
bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
bindsym p exec sxmo_appmenu.sh; mode "default"
bindsym d exec $menu; mode "default"
bindsym Shift+q kill; mode "default"
bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
bindsym Shift+c reload; mode "default"
bindsym f fullscreen; mode "default"
bindsym Shift+space floating toggle; mode "default"
bindsym a focus parent; mode "default"
}
### Key bindings
#
# Basics:
#
input * xkb_options compose:ralt
# Nokia N900 hardware keyboard
input "1:1:TWL4030_Keypad" {
xkb_model "nokiarx51"
xkb_layout "us"
# ralt has special meaning on N900 keyboard so do not use as
# compose key
xkb_options compose:rwin
}
# Start a terminal
bindsym $mod+Return exec $term
# Launch appmenu
bindsym $mod+p exec sxmo_appmenu.sh
bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
# Wm menu switcher
bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Move the focused workspace to output
bindsym $mod+Shift+Ctrl+$left move workspace output left
bindsym $mod+Shift+Ctrl+$down move workspace output down
bindsym $mod+Shift+Ctrl+$up move workspace output up
bindsym $mod+Shift+Ctrl+$right move workspace output right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
# Manual locker
bindsym $mod+g exec sxmo_state.sh set locker
# Shutdown
bindsym $mod+t exec sxmo_appmenu.sh power
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 30px
bindsym $down resize grow height 30px
bindsym $up resize shrink height 30px
bindsym $right resize grow width 30px
# Ditto, with arrow keys
bindsym Left resize shrink width 30px
bindsym Down resize grow height 30px
bindsym Up resize shrink height 30px
bindsym Right resize grow width 30px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
height 24
font "Sxmo 13"
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command sxmo_status_watch.sh -o pango
pango_markup enabled
colors {
statusline #ffffff
background #323232
inactive_workspace #323232 #323232 #ffffff
font "Sxmo 13"
}
}
for_window [app_id="pinentry-.*"] floating true
for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
for_window [title="megapixels"] inhibit_idle open
for_window [title="ep[yr].*"] inhibit_idle visible
default_border pixel 2
titlebar_border_thickness 2
hide_edge_borders smart
# Need playerctl installed and running
bindsym --locked XF86AudioPlay exec playerctl play-pause
bindsym --locked XF86AudioPause exec playerctl play-pause
bindsym --locked XF86AudioStop exec playerctl stop
bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioPrev exec playerctl previous
bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
# Nokia N900-specific key bindings:
# 1. Bind lock key (XF86ScreenSaver)
# Use keycode due to https://github.com/swaywm/sway/issues/8438
bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
# 2. Workaround the lack of a free ModX key on hardware keyboard
bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
bindsym Print exec sxmo_screenshot.sh
bindsym button2 kill
bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
# Nokia 8110 4G hardware keypad bindings (User:Ybon)
bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
include /etc/sway/config.d/*
exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
exec sxmo_hook_start.sh
# vim: ft=swayconfig
@@ -1,6 +0,0 @@
# Space to setup configversion
# configversion: 4de2da84af48414f557742c29bde606e
anchor = top
width = 220
height = 28
margin = 28
@@ -1,51 +0,0 @@
/* Space to setup configversion */
/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
* {
font-family: monospace;
font-size: 15px;
}
window {
margin: 0px;
border: 2px solid #005577;
background-color: #1c1c1c;
}
#input {
margin: 0px;
padding: 4px 6px;
border-radius: 0px;
border: 1px solid #005577;
background-color: #383838;
color: #ffffff;
font-size: 15px;
font-weight: bold;
}
#inner-box {
margin: 0px;
}
#outer-box {
margin: 1px;
}
#scroll {
margin: 0px;
color: #ffdd00;
}
#text {
margin: 1px 4px;
color: #ffffff;
}
#entry {
padding: 3px 2px;
margin: 0px;
}
#entry:selected {
background-color: #005577;
font-weight: bold;
}
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# configversion: 36730424afa6d6bf9e9fb6d111c35504
dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
# Run actions on start
sxmo_hook_start.sh &
+14 -8
View File
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
out_to_x = false,
out_to_wayland = true,
output_backend = 'x11',
out_to_x = true,
out_to_wayland = false,
own_window = true,
own_window_type = 'override',
own_window_transparent = true,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
double_buffer = true,
alignment = 'top_middle',
gap_y = 12,
own_window_argb_value = 0,
own_window_type = 'desktop',
gap_x = 0,
gap_y = 34,
default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
font = 'Sxmo:size=13',
font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
@@ -8,6 +8,15 @@
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
APPS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache"
if [ -f "$APPS_CACHE" ] && [ ! "$0" -nt "$APPS_CACHE" ] && [ ! /usr/bin -nt "$APPS_CACHE" ] && [ ! /usr/local/bin -nt "$APPS_CACHE" ]; then
cat "$APPS_CACHE"
exit 0
fi
exec 3>&1 > "$APPS_CACHE.tmp"
trap 'mv -f "$APPS_CACHE.tmp" "$APPS_CACHE" 2>/dev/null; cat "$APPS_CACHE" >&3 2>/dev/null' EXIT
write_line() {
printf "%s ^ 0 ^ %s\n" "$1" "$2"
}
@@ -69,8 +78,6 @@ write_line_app firefox-esr "$icon_ffx Firefox ESR" "firefox-esr"
write_line_app flare "$icon_msg Flare" "flare"
write_line_app flowtime "$icon_hrg Flowtime" "flowtime"
write_line_app foliate "$icon_bok Foliate" "foliate"
( [ -n "$WAYLAND_DISPLAY" ] && command -v foot >/dev/null) && \
write_line "$icon_trm Foot" "foot $SHELL"
write_line_app foxtrotgps "$icon_gps Foxtrotgps" "foxtrotgps"
write_line_app fractal "$icon_msg Fractal" "fractal"
write_line_app fragments "$icon_rld Fragments" "fragments"
@@ -195,8 +202,7 @@ write_line_app siglo "$icon_clk Siglo" "siglo"
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
write_line_app solanum "$icon_pom Solanum" "solanum"
([ -z "$WAYLAND_DISPLAY" ] && command -v st >/dev/null) && \
write_line "$icon_trm St" "st -e $SHELL"
write_line_app st "$icon_trm St" "st -e ${SHELL:-/bin/sh}"
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
write_line_app surf "$icon_glb Surf" "surf"
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
@@ -1,30 +1,64 @@
#!/bin/sh
# configversion: d031535bc22ba19d69704317b8d50560
load_data() {
data="$(upower -i "$1" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
}
data_get() {
printf "%b" "$data" | grep "^$1:" | cut -d: -f2
}
SET_LED_PATH="$XDG_RUNTIME_DIR/sxmo_hook_battery_set_led"
device_changed() {
name="$(data_get "native-path")"
state="$(data_get "state")"
percentage="$(data_get "percentage" | cut -d% -f1)"
object="${1:-/org/freedesktop/UPower/devices/battery_default}"
event="${2:-device changed}"
if [ -z "$name" ] || [ -z "$state" ]; then
return
fi
case "$event" in
"device changed") ;;
*) exit 0 ;;
esac
if [ "$state" = unknown ]; then
return
fi
case "$object" in
*/battery_*)
raw_name="${object##*/battery_}"
;;
*)
exit 0
;;
esac
sysfs_dir=""
if [ -d "/sys/class/power_supply/$raw_name" ]; then
sysfs_dir="/sys/class/power_supply/$raw_name"
name="$raw_name"
else
for d in /sys/class/power_supply/*; do
[ -r "$d/type" ] || continue
read -r pstype < "$d/type" 2>/dev/null || continue
if [ "$pstype" = "Battery" ]; then
sysfs_dir="$d"
name="${d##*/}"
break
fi
done
fi
if [ -n "$sysfs_dir" ] && [ -r "$sysfs_dir/capacity" ] && [ -r "$sysfs_dir/status" ]; then
read -r percentage < "$sysfs_dir/capacity" 2>/dev/null || percentage=""
read -r raw_status < "$sysfs_dir/status" 2>/dev/null || raw_status=""
case "$raw_status" in
"Full"|"full") state="fully-charged" ;;
"Charging"|"charging") state="charging" ;;
"Discharging"|"discharging"|"Not charging"|"not charging") state="discharging" ;;
*) state="unknown" ;;
esac
else
data="$(upower -i "$object" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
[ "$type" = "battery" ] || exit 0
name="$(printf "%b" "$data" | grep "^native-path:" | cut -d: -f2)"
state="$(printf "%b" "$data" | grep "^state:" | cut -d: -f2)"
percentage="$(printf "%b" "$data" | grep "^percentage:" | cut -d: -f2 | cut -d% -f1)"
fi
if [ -z "$name" ] || [ -z "$state" ] || [ -z "$percentage" ] || [ "$state" = "unknown" ]; then
exit 0
fi
if [ -z "$SXMO_DISABLE_LEDS" ]; then
if [ "$percentage" -lt 25 ] && [ ! -f "$SET_LED_PATH" ]; then
touch "$SET_LED_PATH"
sxmo_led.sh set red 100
@@ -32,21 +66,17 @@ device_changed() {
rm "$SET_LED_PATH"
sxmo_led.sh set red 0
fi
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
}
object="$1"
event="$2"
load_data "$object"
if [ "$type" != "battery" ]; then
exit
fi
case "$event" in
"device changed")
device_changed "$object"
;;
esac
CACHE_FILE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_bat_state_${name}"
ICON_FILE="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}/040-battery-icon-${name}"
NEW_VAL="${state}:${percentage}"
if [ -r "$CACHE_FILE" ] && [ -f "$ICON_FILE" ]; then
read -r OLD_VAL < "$CACHE_FILE" 2>/dev/null || OLD_VAL=""
if [ "$OLD_VAL" = "$NEW_VAL" ]; then
exit 0
fi
fi
printf '%s\n' "$NEW_VAL" > "$CACHE_FILE"
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"

Some files were not shown because too many files have changed in this diff Show More