Skip to content

Commit

Permalink
X + i3 -> Wayland + sway
Browse files Browse the repository at this point in the history
  • Loading branch information
fortes committed Jul 30, 2024
1 parent 2921d60 commit 26db1cf
Show file tree
Hide file tree
Showing 59 changed files with 1,357 additions and 905 deletions.
67 changes: 57 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ This is only public so I can easily share it across machines. There is probably
My usage is mostly terminal-based, via Crostini on Chromebook, WSL2 on Windows, and (rarely) MacOS terminal. Making heavy use of:

* Bash / Tmux
* FZF
* FZF / pistol / fd / ripgrep
* Neovim
* cmus

Graphical sections are Linux-only, and use:

* i3wm & picom & dunst & rofi
* Alacritty
* sway / swaync / waybar
* foot
* Firefox

## Letting me own your machine
Expand Down Expand Up @@ -215,6 +215,54 @@ The Bullseye to Bookworm upgrade requires a few manual steps that I'm too lazy t
- `exa` is now unmaintained, need to either go to [eza](https://github.com/eza-community/eza) or `lsd`
- `1password` GUI not installing correctly, something wrong w/ bash logic
## Sway Migration
Work in progress. The [Sway Wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide) has some good links for migration, and there are [useful tools](https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway) as well
- Chromium: Need to either use command-line flags `--ozone-platform-hint=auto` or go to `chrome://flags` and set `Preferred Ozone platform`
- Read through [this guide](https://anarc.at/software/desktop/wayland/) a bit more, lots of good detail and using debian and systemd to drive a bunch of stuff
- Notifications
- [x] `sway-notification-center` over dunst, much better
- [ ] No need to start automatically, dbus does that
- [ ] Figure out volume, etc controls in there. Can substitute for some of the waybar stuff
- Looks like this is on newer version than what's in Debian repos, so need to either go to sid early, or just wait
- Can also do arbitrary buttons?
- [ ] Figure out how to show icons for screenshot, etc
- [ ] Make styling a bit more consistent with rest of UX
- Bar
- Figure out bar content, using some combination of `waybar` and the [helpers](https://github.com/swaywm/sway/wiki/Useful-add-ons-for-sway#bar-content-generators)
- [ ] Music control
- [ ] Better volume display
- [ ] Screen recording indicator could be nice
- [ ] Figure out clipboard, likely `wl-clipboard` (`wayclip` not in repos)
- [ ] Need to hook up pipewire in tmux as well?
- [ ] Input / keyboard setup, mostly native in sway?
- [ ] `swhkd` to consider as hotkey handler, get `sway` out of the business?
- [ ] Update instructions for setup
- get `sway/config.local` out of source control, etc
- [ ] Figure out how to make wacom tablet work (and update instructions)
- [OpenTabletDriver](https://github.com/OpenTabletDriver/OpenTabletDriver) looks promising, but need to test
- [x] Figure out how to get things using Wayland where necessary
- Firefox, Chrome need flags
- Signal as well, watch out for needing floating at start
- `signal-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland`
- [x] Need to update screenshot scripts, will likely be `grim` / `slurp` / `grimshot`
- Screen recording via `wf-recorder`?
- [x] Volume keyboard controls not working
- [x] Need a `rofi` replacement for app launching, window switching, and shutdown, etc commands.
- Might consider just using a terminal with `fzf`, but need to figure out the data sources
- `wofi` kinda working, need to get terminal apps running (e.g. `htop`)
- Window switcher kinda works, need icons
- [x] `gammastep` seems to work on Wayland, need to figure out all the launching, etc
- `gammastep-indicator` broken due to not including `/usr/lib/python3/dist-packages` in `PYTHONPATH`, works if done manually, not sure if something wrong with sway config or what
- Need to double-check at night, but should be good?
- [x] `dunst` seems to support wayland, but need to get launching, etc.
- Hm, dbus does this for us, probably fine
- `mako-notifier` an option, need to configure in order to get icons
- [x] Tray doesn't seem to work? Should have gammastep there?
- Tray does work, just nothing in it right now
- [x] Need to port background drawing handling over, likely using `swaybg` or just native sway
## Future Improvements
- Try switching from docker to podman
Expand All @@ -224,17 +272,16 @@ The Bullseye to Bookworm upgrade requires a few manual steps that I'm too lazy t
- [ ] (caniuse-cli)[https://github.com/sgentle/caniuse-cmd]
- [ ] Look into `stevearc/conform.nvim`
- [ ] Add [Firefox Nightly](https://blog.nightly.mozilla.org/2023/10/30/introducing-mozillas-firefox-nightly-deb-packages-for-debian-based-linux-distributions/)
- [ ] Figure out why gammastep not starting up automatically in some cases, may need to re-write the systemd user entries
- [ ] Use [native OSC52 support in Neovim](https://github.com/neovim/neovim/issues/3344) instead of plugin
- [ ] sixel support in tmux 3.4, but gotta wait until it (hopefully) hits Debian backports
- Once sixels are supported, can make a bunch of improvements to scripts here
- May want to consider `zellij` which supports sixel? Currently slightly janky though
- [ ] `wshowkeys` or similar for showing keypresses for screencasts, etc
- [ ] Figure out Lutris / Wine / Proton for Linux gaming
- [ ] [Auto-publish Docker images](https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages)
- [ ] Better colorschemes, coordinated everywhere
- [ ] Easier swapping into light mode
- Check [themer](https://github.com/themerdev/themer) for generation
- [ ] Setup `xautolock` or similar to automatically lock screen on idle
- [ ] Figure out rofi / dmenu whatever else would make sense to do more in i3
- [ ] Check out [`zutty` terminal](https://tomscii.sig7.se/zutty/)
- [ ] Migrate off of X11 to Wayland: Either use nouveau or wait until Sway has Nvidia support (or get an AMD card)
- [ ] `foot` on Wayland seems to be quite good for terminal
- [ ] Easier swapping into light mode
- [ ] Figure out how to get USB-C DP Alt devices to work, might need [displaylink-debian](https://github.com/AdnanHodzic/displaylink-debian) or at the very least `evdi-dkms`
- [ ] Get [Nvidia Drivers](https://wiki.debian.org/NvidiaGraphicsDrivers) drivers with a reasonable resolution for linux console
- Install `nvidia-detect` and run to check support
Expand Down
39 changes: 19 additions & 20 deletions scripts/apt-packages
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
alacritty
alsa-utils
chromium
cmake
cmus
dbus-x11
dex
dunst
exfat-fuse
exfatprogs
feh
foliate
fonts-dejavu
fonts-font-awesome
fonts-hack
fonts-noto
fonts-noto-color-emoji
fonts-noto-mono
fonts-noto-ui-core
fonts-roboto
fonts-open-sans
foot
foot-themes
fuzzel
gammastep
gnome-keyring
hsetroot
i3
i3blocks
i3lock
imv
kitty
libnotify-bin
libpam-gnome-keyring
lxqt-policykit
maim
mkchromecast
mpv
mpv-mpris
papirus-icon-theme
pasystray
picom
pipewire
playerctl
pulseaudio
rofi
slop
software-properties-common
x11-xserver-utils
xclip
xdotool
xinit
xsel
xserver-xorg
xzoom
sway
sway-backgrounds
sway-notification-center
swayidle
swaylock
waybar
wev
wf-recorder
xwayland
2 changes: 1 addition & 1 deletion scripts/create_local_profile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ main() {
# Default to headless in Crostini / Docker / WSL, even though GUI might be
# possible, can always be overridden
local is_headless=$([[ -n "${is_crostini}${is_docker}${is_wsl}" || \
-z "${DISPLAY:-}" ]] && printf 1)
-z "${WAYLAND_DISPLAY:-}" ]] && printf 1)

cat <<PROFILE_TEMPLATE
# Generated $(date +%F)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Signal
Exec=signal-desktop --no-sandbox --enable-features=UseOzonePlatform --ozone-platform-hint=auto %U
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Comment=Private messaging from your desktop
MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha;
Categories=Network;InstantMessaging;Chat;
5 changes: 0 additions & 5 deletions stowed-files/X/.Xresources

This file was deleted.

9 changes: 0 additions & 9 deletions stowed-files/X/.xinitrc

This file was deleted.

13 changes: 0 additions & 13 deletions stowed-files/X/.xsession

This file was deleted.

60 changes: 0 additions & 60 deletions stowed-files/alacritty/.config/alacritty/alacritty.yml

This file was deleted.

10 changes: 2 additions & 8 deletions stowed-files/bash/.aliases
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,8 @@ elif uname | grep -qv Darwin; then
alias ll='ls --color=auto -AlpFhv'
fi

# Make feh nicer in i3
if command_exists feh; then
alias feh='feh --scale-down'
fi

# Shortcuts for copying from tmux clipboard to system clipboard
if command_exists xclip; then
alias tcopy='tmux save-buffer - | xclip -i -sel clipboard'
if command_exists imv-wayland; then
alias imv='imv-wayland'
fi

# Debianisms outside of Debian
Expand Down
3 changes: 3 additions & 0 deletions stowed-files/bash/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ export FZF_CTRL_T_OPTS="
"
export FZF_COMPLETION_OPTS='--smart-case'

# Use wayland for Firefox
export MOZ_ENABLE_WAYLAND=1

# FZF keybindings (Debian)
source_if_exists "/usr/share/doc/fzf/examples/key-bindings.bash"
# FZF keybindings (Homebrew)
Expand Down
14 changes: 0 additions & 14 deletions stowed-files/bin/.local/bin/notify

This file was deleted.

24 changes: 16 additions & 8 deletions stowed-files/bin/.local/bin/yank
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# Copies to clipboard, using one or more of the following:
# - tmux
# - xsel
# - Osc52 over SSH
# - wl-copy
# - OSC52 over SSH

set -euo pipefail
IFS=$'\n\t'

isWithinTmux() {
if [ -n "$TMUX" ]; then
Expand All @@ -13,8 +16,8 @@ isWithinTmux() {
fi
}

inX() {
if command -v xhost > /dev/null && xhost 2> /dev/null > /dev/null; then
inWayland() {
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
return 0
else
return 1
Expand All @@ -34,10 +37,15 @@ get_osc52() {
main() {
buf=$(cat "$@")

if inX; then
echo "$buf" | xsel -ib
if inWayland; then
echo "$buf" | wl-copy
if command -v notify-send > /dev/null; then
notify-send --hint=int:transient:1 -u low -t 1000 'Copied!'
notify-send \
--urgency low \
--transient \
--expire-time 1000 \
--icon edit-copy-symbolic \
'Copied!' 'Saved to clipboard'
elif isWithinTmux; then
tmux display-message 'Copied!'
fi
Expand All @@ -51,7 +59,7 @@ main() {

len=${#output}
if [ "${len}" -lt "${OSC_52_MAX_SEQUENCE}" ]; then
printf $output
printf "%s" "${output}"
else
echo "ERROR: selection too long to send to terminal: ${len}" >&2
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Version=1.0
Name=Altium
Comment=Second profile for Chromium
Terminal=false
Exec=sh -c "/usr/bin/chromium --user-data-dir\=\$XDG_CONFIG_HOME/chromium_alt_profile"
Icon=/usr/share/pixmaps/chromium.png
Exec=sh -c '/usr/bin/chromium --user-data-dir=$XDG_CONFIG_HOME/chromium_alt_profile --ozone-platform-hint=auto'
Icon=chromium
Loading

0 comments on commit 26db1cf

Please sign in to comment.