This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

qtile: fix screen sharing, add tty bindings

+118 -97
+53 -31
2configs/desktops/lib/wayland.nix
··· 23 23 ]; 24 24 users.users.mainUser.extraGroups = [ "audio" "pipewire" "video" "input" ]; 25 25 26 + xdg.portal.enable = true; 27 + xdg.portal.wlr.enable = true; 28 + fonts.enableDefaultPackages = true; 29 + 26 30 security.polkit.enable = true; 27 31 security.pam.services.swaylock = { }; 28 32 29 - environment.systemPackages = [ 30 - pkgs.ydotool 31 - pkgs.wl-clipboard 32 - pkgs.rofi 33 - pkgs.swaylock 34 - pkgs.glib 35 - pkgs.dracula-theme 36 - pkgs.gnome3.adwaita-icon-theme 37 - pkgs.zathura 38 - pkgs.sxiv 39 - pkgs.otpmenu 40 - (pkgs.writers.writeDashBin "pass_menu" '' 41 - set -efu 42 - password=$( 43 - (cd $HOME/.password-store; find -type f -name '*.gpg') | 44 - sed -e 's/\.gpg$//' | 45 - rofi -dmenu -p 'Password: ' | 46 - xargs -I{} pass show {} | 47 - tr -d '\n' 48 - ) 49 - printf %s "$password" | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 50 - '') 33 + programs.dconf.enable = lib.mkDefault true; 34 + programs.xwayland.enable = lib.mkDefault true; 35 + 36 + environment.sessionVariables = { 37 + MOZ_ENABLE_WAYLAND = "1"; 38 + XDG_SESSION_TYPE = "wayland"; 39 + SDL_VIDEODRIVER = "wayland"; 40 + QT_QPA_PLATFORM = "wayland"; 41 + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 42 + _JAVA_AWT_WM_NONREPARENTING = "1"; 43 + }; 44 + 45 + programs.wshowkeys.enable = true; 46 + 47 + environment.systemPackages = with pkgs; [ 48 + qtile 49 + swaylock-effects # lockscreen 50 + pavucontrol 51 + swayidle 52 + rofi-wayland 53 + rofi-rbw 54 + gnome.eog 55 + libnotify 56 + mako # notifications 57 + kanshi # auto-configure display outputs 58 + wdisplays # buggy with qtile? 59 + wlr-randr 60 + wl-clipboard 61 + wev 62 + blueberry 63 + grim # screenshots 64 + wtype 65 + 66 + pavucontrol 67 + evince 68 + libnotify 69 + pamixer 70 + gnome.file-roller 71 + xdg-utils 72 + # polkit agent 73 + polkit_gnome 74 + 75 + # gtk3 themes 76 + gsettings-desktop-schemas 51 77 ]; 52 78 53 - services.dbus.enable = true; 54 - xdg.portal = { 55 - enable = true; 56 - wlr.enable = true; 57 - # gtk portal needed to make gtk apps happy 58 - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 59 - }; 60 - fonts.enableDefaultPackages = true; 61 - programs.dconf.enable = lib.mkDefault true; 79 + environment.pathsToLink = [ 80 + "/libexec" # for polkit 81 + "/share/gsettings-schemas" # for XDG_DATA_DIRS 82 + ]; 62 83 84 + qt.platformTheme = "qt5ct"; 63 85 }
+45 -65
2configs/desktops/qtile/default.nix
··· 1 - { pkgs, ... }: 1 + { pkgs, lib, ... }: 2 2 { 3 3 imports = [ 4 4 ../lib/wayland.nix 5 5 ]; 6 - # xdg.portal.enable = true; 7 - # xdg.portal.wlr.enable = true; 8 - # fonts.enableDefaultPackages = true; 9 6 10 - # security.polkit.enable = true; 11 - # security.pam.services.swaylock = { }; 7 + environment.sessionVariables.XDG_CURRENT_DESKTOP = "qtile"; 8 + services.greetd.enable = true; 12 9 13 - # programs.dconf.enable = lib.mkDefault true; 14 - # programs.xwayland.enable = lib.mkDefault true; 10 + # For greetd, we need a shell script into path, which lets us start qtile.service (after importing the environment of the login shell). 11 + services.greetd.settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --cmd ${pkgs.writeScript "startqtile" '' 12 + #! ${pkgs.bash}/bin/bash 15 13 16 - # environment.sessionVariables = { 17 - # MOZ_ENABLE_WAYLAND = "1"; 18 - # XDG_SESSION_TYPE = "wayland"; 19 - # XDG_CURRENT_DESKTOP = "qtile"; 20 - # SDL_VIDEODRIVER = "wayland"; 21 - # QT_QPA_PLATFORM = "wayland"; 22 - # QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 23 - # _JAVA_AWT_WM_NONREPARENTING = "1"; 24 - # }; 14 + # first import environment variables from the login manager 15 + export XDG_DATA_DIRS=/run/current-system/sw/share/gsettings-schemas:$XDG_DATA_DIRS 16 + systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY 17 + systemctl --user import-environment XDG_DATA_DIRS PATH 18 + # then start the service 19 + exec systemctl --user --wait start qtile.service 20 + ''}"; 25 21 26 - # # wayland stuff 27 - # environment.systemPackages = [ 28 - # pkgs.rofi-wayland 29 - # pkgs.wtype 30 - # pkgs.otpmenu 31 - # pkgs.qtile 32 - # pkgs.swaylock 33 - # pkgs.copyq 34 - # (pkgs.writers.writeDashBin "pass_menu" '' 35 - # set -efux 36 - # password=$( 37 - # (cd $HOME/.password-store; find -type f -name '*.gpg') | 38 - # sed -e 's/\.gpg$//' | 39 - # rofi -dmenu -p 'Password: ' | 40 - # xargs -I{} pass show {} | 41 - # tr -d '\n' 42 - # ) 43 - # echo -n "$password" | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 44 - # '') 45 - # (pkgs.writeTextFile { 46 - # name = "configure-gtk"; 47 - # destination = "/bin/configure-gtk"; 48 - # executable = true; 49 - # text = let 50 - # schema = pkgs.gsettings-desktop-schemas; 51 - # datadir = "${schema}/share/gsettings-schemas/${schema.name}"; 52 - # in '' 53 - # export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS 54 - # gnome_schema=org.gnome.desktop.interface 55 - # gsettings set $gnome_schema gtk-theme 'Dracula' 56 - # ''; 57 - # }) 58 - # ]; 59 - 60 - services.xserver.windowManager.qtile = { 61 - enable = true; 62 - backend = "wayland"; 22 + systemd.user.targets.qtile-session = { 23 + description = "Qtile compositor session"; 24 + documentation = [ "man:systemd.special(7)" ]; 25 + bindsTo = [ "graphical-session.target" ]; 26 + wants = [ "graphical-session-pre.target" ]; 27 + after = [ "graphical-session-pre.target" ]; 63 28 }; 64 29 30 + systemd.user.services.qtile = 31 + let 32 + pyEnv = pkgs.python3.withPackages (_p: [ 33 + pkgs.python3.pkgs.qtile 34 + pkgs.python3.pkgs.iwlib 35 + ]); 36 + in 37 + { 38 + description = "Qtile - Wayland window manager"; 39 + documentation = [ "man:qtile(5)" ]; 40 + bindsTo = [ "graphical-session.target" ]; 41 + wants = [ "graphical-session-pre.target" ]; 42 + after = [ "graphical-session-pre.target" ]; 43 + # We explicitly unset PATH here, as we want it to be set by 44 + # systemctl --user import-environment in startqtile 45 + environment.PATH = lib.mkForce null; 46 + environment.PYTHONPATH = lib.mkForce null; 47 + serviceConfig = { 48 + Type = "simple"; 49 + ExecStart = "${pyEnv}/bin/qtile start -b wayland -c /etc/qtile.py"; 50 + Restart = "on-failure"; 51 + RestartSec = 1; 52 + TimeoutStopSec = 10; 53 + }; 54 + }; 55 + 65 56 environment.etc."qtile.py".source = ./qtile.py; 66 - environment.systemPackages = [ 67 - (pkgs.writeTextFile { 68 - name = "qtile.py"; 69 - destination = "/etc/xdg/qtile.py"; 70 - text = builtins.readFile ./qtile.py; 71 - }) 72 - (pkgs.writeScriptBin "startx" '' 73 - qtile start -b wayland -c /etc/qtile.py 74 - '') 75 - pkgs.copyq 76 - ]; 77 57 }
+20 -1
2configs/desktops/qtile/qtile.py
··· 4 4 import os 5 5 from typing import Callable 6 6 7 - from libqtile import bar, layout, widget, extension 7 + from libqtile import bar, layout, widget, extension, hook 8 8 from libqtile.config import Click, Drag, Group, Key, Match, Screen, ScratchPad, DropDown 9 9 from libqtile.lazy import lazy 10 10 from libqtile.utils import guess_terminal ··· 109 109 Key([], "XF86AudioLowerVolume", lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%")), 110 110 Key([], "XF86MonBrightnessUp", lazy.spawn("xbacklight -inc 10")), 111 111 Key([], "XF86MonBrightnessDown", lazy.spawn("xbacklight -dec 10")), 112 + 113 + Key(["control", "mod1"], "F1", lazy.core.change_vt(1), desc="Switch to VT 1"), 114 + Key(["control", "mod1"], "F2", lazy.core.change_vt(2), desc="Switch to VT 2"), 115 + Key(["control", "mod1"], "F3", lazy.core.change_vt(3), desc="Switch to VT 3"), 116 + Key(["control", "mod1"], "F4", lazy.core.change_vt(4), desc="Switch to VT 4"), 117 + Key(["control", "mod1"], "F5", lazy.core.change_vt(5), desc="Switch to VT 5"), 118 + Key(["control", "mod1"], "F6", lazy.core.change_vt(6), desc="Switch to VT 6"), 112 119 ] 113 120 114 121 layouts = [ ··· 219 226 wl_input_rules = { 220 227 "type:keyboard": InputConfig(kb_options="ctrl:nocaps", kb_layout="us", kb_variant="altgr-intl"), 221 228 } 229 + 230 + @hook.subscribe.startup 231 + def autostart(): 232 + subprocess.run( 233 + [ 234 + "systemctl", 235 + "--user", 236 + "import-environment", 237 + "XDG_SESSION_PATH", 238 + "WAYLAND_DISPLAY", 239 + ] 240 + ) 222 241 223 242 # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this 224 243 # string besides java UI toolkits; you can see several discussions on the