nix-config/home/dwm.nix
Donovan Glover b00b2dd8d4
meta: Document usage of dwm on phone
This worked and was *significantly* faster than Phosh but resulted in a
lot of phone things broken like phone calls and the camera. Overall
quite cool to run dwm on the PinePhone but not really practical when
trying to use the PinePhone as a phone.
2024-08-28 19:52:17 -04:00

89 lines
2.0 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, ... }:
let
barScript = "dwm/bar.fish";
phosh-backgrounds = pkgs.callPackage ../packages/phosh-backgrounds.nix { };
in
{
home = {
packages = with pkgs; [
feh
xclip
scrot
CuboCore.corekeyboard
];
file.".xinitrc" = {
executable = true;
text = # bash
''
#!/usr/bin/env sh
export XDG_SESSION_TYPE=x11
export GDK_BACKEND=x11
export XDG_CURRENT_DESKTOP=dwm
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SDL_IM_MODULE=fcitx
export GLFW_IM_MODULE=ibus
export GTK_CSD=0
export MOZ_USE_XINPUT2=1
xrdb -merge ~/.Xresources
xset r rate 300 50
feh --no-fehbg --bg-scale ${phosh-backgrounds}/wall-lock.jpg
~/.config/${barScript} &
fcitx5 &
kitty &
corekeyboard &
while true; do
dbus-launch --sh-syntax --exit-with-session dwm
done
'';
};
};
xdg.configFile = {
${barScript} = {
executable = true;
text = # fish
''
#!/usr/bin/env fish
function get_icon
if test "$argv" -gt 90
echo " "
else if test "$argv" -gt 60
echo " "
else if test "$argv" -gt 30
echo " "
else if test "$argv" -gt 10
echo " "
else
echo " "
end
end
function update_bar
set VOLUME "$(math "$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) * 100")%"
set TIME "$(date '+%x%a%R')"
set capacity "$(cat /sys/class/power_supply/BAT0/capacity)"
set BATTERY "$(get_icon $capacity)$capacity%"
xsetroot -name " $VOLUME$BATTERY$TIME "
end
while true
update_bar
sleep 10s
end
'';
};
};
}