alpha
Login
or
Join now
hermes.pds.lassul.us
/
superconfig
forked from
lass.pds.lassul.us/superconfig
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
sway: run waybar as a user service
author
lassulus
date
10 months ago
(Dec 2, 2025, 1:48 PM CET)
commit
c85f7613
c85f7613004688b6a5fc2bedc64ddf7af43a9af8
parent
a0a51984
a0a51984980ae9c5c78a3a0f37d8d6886d5e9e59
+20
-9
1 changed file
Expand all
Collapse all
Unified
Split
2configs
desktops
sway
default.nix
+20
-9
2configs/desktops/sway/default.nix
View file
Reviewed
···
1
1
-
{ pkgs, ... }:
1
1
+
{ pkgs, lib, ... }:
2
2
let
3
3
4
4
term = "/run/current-system/sw/bin/alacritty";
···
121
121
programs.sway = {
122
122
enable = true;
123
123
wrapperFeatures.gtk = true;
124
124
+
extraSessionCommands = ''
125
125
+
export SWAYSOCK=/run/user/$(id -u)/sway-ipc.sock
126
126
+
'';
127
127
+
};
128
128
+
129
129
+
systemd.user.services.waybar = {
130
130
+
description = "Highly customizable Wayland bar for Sway";
131
131
+
documentation = [ "man:waybar(5)" ];
132
132
+
partOf = [ "sway-session.target" ];
133
133
+
wantedBy = [ "sway-session.target" ];
134
134
+
serviceConfig = {
135
135
+
Type = "simple";
136
136
+
ExecStart = "${pkgs.waybar}/bin/waybar -c ${waybarConfig} -s ${waybarStyle}";
137
137
+
Restart = "on-failure";
138
138
+
RestartSec = 1;
139
139
+
};
124
140
};
125
141
126
142
environment.etc."sway/config".text = ''
···
281
297
}
282
298
bindsym $mod+r mode "resize"
283
299
284
284
-
#
285
285
-
# Status Bar:
286
286
-
#
287
287
-
exec_always pkill waybar; exec ${pkgs.waybar}/bin/waybar -c ${waybarConfig} -s ${waybarStyle}
288
288
-
289
300
default_border pixel 1
290
301
default_floating_border none
291
302
smart_borders on
···
338
349
# theme and env specific stuff
339
350
exec_always ${pkgs.writers.writeDash "dbus-sway-environment" ''
340
351
set -efux
341
341
-
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
342
342
-
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
343
343
-
systemctl --user start --no-block sway-session.target
352
352
+
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
353
353
+
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
354
354
+
systemctl --user restart --no-block sway-session.target
344
355
systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr
345
356
systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr
346
357
''}