Switch to Wayland
This commit is contained in:
parent
b19476f92b
commit
64e94d4ff8
22 changed files with 503 additions and 1040 deletions
|
|
@ -4,9 +4,7 @@ with lib;
|
|||
with lib.my;
|
||||
let cfg = config.modules.desktop.alacritty;
|
||||
in {
|
||||
options.modules.desktop.alacritty = {
|
||||
enable = mkBoolOpt false;
|
||||
};
|
||||
options.modules.desktop.alacritty = { enable = mkBoolOpt false; };
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${config.user.name} = {
|
||||
programs.alacritty = {
|
||||
|
|
|
|||
|
|
@ -10,14 +10,22 @@ let
|
|||
sha256 = "sha256-obKI4qZvucogqRCl51lwV9X8SRaMqcbBwWMfc9TupIo=";
|
||||
};
|
||||
in {
|
||||
config = mkIf config.services.xserver.enable {
|
||||
|
||||
options.modules.desktop = {
|
||||
wallpaper = mkOption {
|
||||
type = types.path;
|
||||
default = wallpaper;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.modules.desktop.hyprland.enable {
|
||||
|
||||
fonts = {
|
||||
packages = with pkgs.unstable; [
|
||||
corefonts # Microsoft free fonts
|
||||
(nerdfonts.override { fonts = [ "Meslo" "NerdFontsSymbolsOnly" ]; })
|
||||
];
|
||||
fontconfig.defaultFonts = { monospace = [ "MesloLGS Nerd Font Mono" ]; };
|
||||
fontconfig.defaultFonts = { monospace = [ "MesloLGS Nerd Font" ]; };
|
||||
};
|
||||
|
||||
programs.adb.enable = true;
|
||||
|
|
@ -28,15 +36,6 @@ in {
|
|||
|
||||
home-manager.users.${config.user.name} = {
|
||||
|
||||
xsession = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
${pkgs.feh}/bin/feh --bg-fill ${wallpaper}
|
||||
keepassxc &
|
||||
'';
|
||||
numlock.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
nextcloud-client.enable = true;
|
||||
udiskie.enable = true;
|
||||
|
|
@ -46,11 +45,6 @@ in {
|
|||
pinentryFlavor = "gtk2";
|
||||
};
|
||||
unclutter.enable = true;
|
||||
screen-locker = {
|
||||
enable = false;
|
||||
inactiveInterval = 5;
|
||||
lockCmd = "${pkgs.i3lock}/bin/i3lock -e -f -c 000000 -i ${wallpaper}";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
|
@ -95,9 +89,9 @@ in {
|
|||
ocr = {
|
||||
name = "OCR image";
|
||||
exec = "${pkgs.writeScript "ocr" ''
|
||||
${pkgs.xfce.xfce4-screenshooter}/bin/xfce4-screenshooter -r --save /dev/stdout | \
|
||||
${pkgs.tesseract}/bin/tesseract -l eng+fre - - | \
|
||||
${pkgs.xclip}/bin/xclip -sel clip
|
||||
${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | \
|
||||
${pkgs.tesseract}/bin/tesseract stdin stdout -l eng+fre | \
|
||||
${pkgs.wl-clipboard}/bin/wl-copy
|
||||
''}";
|
||||
};
|
||||
};
|
||||
|
|
@ -143,27 +137,22 @@ in {
|
|||
options = [ "caps:escape" ];
|
||||
};
|
||||
|
||||
file = { ".wallpaper.jpg".source = wallpaper; };
|
||||
|
||||
sessionVariables.EDITOR = "vim";
|
||||
|
||||
packages = with pkgs.unstable; [
|
||||
xorg.xinit
|
||||
xorg.xwininfo
|
||||
xorg.xkill
|
||||
|
||||
brave
|
||||
ungoogled-chromium
|
||||
mullvad-browser
|
||||
keepassxc
|
||||
krita
|
||||
element-desktop
|
||||
feh
|
||||
mpv
|
||||
jellyfin-mpv-shim
|
||||
mumble
|
||||
libreoffice-fresh
|
||||
onlyoffice-bin
|
||||
thunderbird
|
||||
pkgs.thunderbird
|
||||
portfolio
|
||||
gnucash
|
||||
transmission-remote-gtk
|
||||
|
|
@ -183,32 +172,6 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
systemd.user.services.activitywatch = {
|
||||
Unit.Description = "Start ActivityWatch";
|
||||
Service.Type = "simple";
|
||||
Service.ExecStart = "${pkgs.unstable.activitywatch-bin}/bin/aw-server";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service.Restart = "on-failure";
|
||||
Service.RestartSec = 5;
|
||||
};
|
||||
systemd.user.services.activitywatch-afk = {
|
||||
Unit.Description = "Start ActivityWatch AFK";
|
||||
Service.Type = "simple";
|
||||
Service.ExecStart =
|
||||
"${pkgs.unstable.activitywatch-bin}/bin/aw-watcher-afk";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service.Restart = "on-failure";
|
||||
Service.RestartSec = 5;
|
||||
};
|
||||
systemd.user.services.activitywatch-window = {
|
||||
Unit.Description = "Start ActivityWatch Window";
|
||||
Service.Type = "simple";
|
||||
Service.ExecStart =
|
||||
"${pkgs.unstable.activitywatch-bin}/bin/aw-watcher-window";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service.Restart = "on-failure";
|
||||
Service.RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
42
modules/desktop/file-manager.nix
Normal file
42
modules/desktop/file-manager.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let cfg = config.modules.desktop.file-manager;
|
||||
in {
|
||||
options.modules.desktop.file-manager = { enable = mkBoolOpt false; };
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${config.user.name} = {
|
||||
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
manager = {
|
||||
sort_by = "alphabetical";
|
||||
linemode = "mtime";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with pkgs.unstable; [
|
||||
ffmpegthumbnailer
|
||||
unar
|
||||
poppler
|
||||
fd
|
||||
ripgrep
|
||||
ueberzugpp
|
||||
exiftool
|
||||
chafa
|
||||
xdg-utils
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
## This script is a template script for creating textual file previews in Joshuto.
|
||||
##
|
||||
## Copy this script to your Joshuto configuration directory and refer to this
|
||||
## script in `joshuto.toml` in the `[preview]` section like
|
||||
## ```
|
||||
## preview_script = "~/.config/joshuto/preview_file.sh"
|
||||
## ```
|
||||
## Make sure the file is marked as executable:
|
||||
## ```sh
|
||||
## chmod +x ~/.config/joshuto/preview_file.sh
|
||||
## ```
|
||||
## Joshuto will call this script for each file when first hovered by the cursor.
|
||||
## If this script returns with an exit code 0, the stdout of this script will be
|
||||
## the file's preview text in Joshuto's right panel.
|
||||
## The preview text will be cached by Joshuto and only renewed on reload.
|
||||
## ANSI color codes are supported if Joshuto is build with the `syntax_highlight`
|
||||
## feature.
|
||||
##
|
||||
## This script is considered a configuration file and must be updated manually.
|
||||
## It will be left untouched if you upgrade Joshuto.
|
||||
##
|
||||
## Meanings of exit codes:
|
||||
##
|
||||
## code | meaning | action of ranger
|
||||
## -----+------------+-------------------------------------------
|
||||
## 0 | success | Display stdout as preview
|
||||
## 1 | no preview | Display no preview at all
|
||||
##
|
||||
## This script is used only as a provider for textual previews.
|
||||
## Image previews are independent from this script.
|
||||
##
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
# Security measures:
|
||||
# * noclobber prevents you from overwriting a file with `>`
|
||||
# * noglob prevents expansion of wild cards
|
||||
# * nounset causes bash to fail if an undeclared variable is used (e.g. typos)
|
||||
# * pipefail causes a pipeline to fail also if a command other than the last one fails
|
||||
set -o noclobber -o noglob -o nounset -o pipefail
|
||||
|
||||
# Enable exiftool large file support
|
||||
shopt -s expand_aliases
|
||||
alias exiftool='exiftool -api largefilesupport=1'
|
||||
|
||||
FILE_PATH=""
|
||||
PREVIEW_WIDTH=10
|
||||
PREVIEW_HEIGHT=10
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
"--path")
|
||||
shift
|
||||
FILE_PATH="$1"
|
||||
;;
|
||||
"--preview-width")
|
||||
shift
|
||||
PREVIEW_WIDTH="$1"
|
||||
;;
|
||||
"--preview-height")
|
||||
shift
|
||||
# shellcheck disable=SC2034
|
||||
PREVIEW_HEIGHT="$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
handle_extension() {
|
||||
case "${FILE_EXTENSION_LOWER}" in
|
||||
## Archive
|
||||
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
|
||||
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
|
||||
atool --list -- "${FILE_PATH}" && exit 0
|
||||
tar --list --file "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
rar)
|
||||
## Avoid password prompt by providing empty password
|
||||
unrar lt -p- -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
7z)
|
||||
## Avoid password prompt by providing empty password
|
||||
7z l -p -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## PDF
|
||||
pdf)
|
||||
## Preview as text conversion
|
||||
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
|
||||
fmt -w "${PREVIEW_WIDTH}" && exit 0
|
||||
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
|
||||
fmt -w "${PREVIEW_WIDTH}" && exit 0
|
||||
exiftool "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## BitTorrent
|
||||
torrent)
|
||||
transmission-show -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## OpenDocument
|
||||
odt|sxw)
|
||||
## Preview as text conversion
|
||||
odt2txt "${FILE_PATH}" && exit 0
|
||||
## Preview as markdown conversion
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
ods|odp)
|
||||
## Preview as text conversion (unsupported by pandoc for markdown)
|
||||
odt2txt "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## XLSX
|
||||
xlsx)
|
||||
## Preview as csv conversion
|
||||
## Uses: https://github.com/dilshod/xlsx2csv
|
||||
xlsx2csv -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## HTML
|
||||
htm|html|xhtml)
|
||||
## Preview as text conversion
|
||||
w3m -dump "${FILE_PATH}" && exit 0
|
||||
lynx -dump -- "${FILE_PATH}" && exit 0
|
||||
elinks -dump "${FILE_PATH}" && exit 0
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" && exit 0
|
||||
;;
|
||||
|
||||
## JSON
|
||||
json|ipynb)
|
||||
jq --color-output . "${FILE_PATH}" && exit 0
|
||||
python -m json.tool -- "${FILE_PATH}" && exit 0
|
||||
;;
|
||||
|
||||
## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
|
||||
## by file(1).
|
||||
dff|dsf|wv|wvc)
|
||||
mediainfo "${FILE_PATH}" && exit 0
|
||||
exiftool "${FILE_PATH}" && exit 0
|
||||
;; # Continue with next handler on failure
|
||||
esac
|
||||
}
|
||||
|
||||
handle_mime() {
|
||||
local mimetype="${1}"
|
||||
|
||||
case "${mimetype}" in
|
||||
## RTF and DOC
|
||||
text/rtf|*msword)
|
||||
## Preview as text conversion
|
||||
## note: catdoc does not always work for .doc files
|
||||
## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
|
||||
catdoc -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## DOCX, ePub, FB2 (using markdown)
|
||||
## You might want to remove "|epub" and/or "|fb2" below if you have
|
||||
## uncommented other methods to preview those formats
|
||||
*wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml)
|
||||
## Preview as markdown conversion
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" | bat -l markdown \
|
||||
--color=always --paging=never \
|
||||
--style=plain \
|
||||
--terminal-width="${PREVIEW_WIDTH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## E-mails
|
||||
message/rfc822)
|
||||
## Parsing performed by mu: https://github.com/djcb/mu
|
||||
mu view -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## XLS
|
||||
*ms-excel)
|
||||
## Preview as csv conversion
|
||||
## xls2csv comes with catdoc:
|
||||
## http://www.wagner.pp.ru/~vitus/software/catdoc/
|
||||
xls2csv -- "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## Text
|
||||
text/* | */xml)
|
||||
bat --color=always --paging=never \
|
||||
--style=plain \
|
||||
--terminal-width="${PREVIEW_WIDTH}" \
|
||||
"${FILE_PATH}" && exit 0
|
||||
cat "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## DjVu
|
||||
image/vnd.djvu)
|
||||
## Preview as text conversion (requires djvulibre)
|
||||
djvutxt "${FILE_PATH}" | fmt -w "${PREVIEW_WIDTH}" && exit 0
|
||||
exiftool "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## Image
|
||||
image/png | image/jpeg)
|
||||
## Display image
|
||||
exit 0 ;;
|
||||
image/*)
|
||||
## Preview as text conversion
|
||||
exiftool "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
|
||||
## Video and audio
|
||||
video/* | audio/*)
|
||||
mediainfo "${FILE_PATH}" && exit 0
|
||||
exiftool "${FILE_PATH}" && exit 0
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||
FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
|
||||
handle_extension
|
||||
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||
handle_mime "${MIMETYPE}"
|
||||
|
||||
exit 1
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
export joshuto_wrap_id="$$"
|
||||
joshuto_wrap_tmp="$(mktemp -d -t joshuto-wrap-$joshuto_wrap_id-XXXXXX)"
|
||||
export joshuto_wrap_tmp
|
||||
export joshuto_wrap_preview_meta="$joshuto_wrap_tmp/preview-meta"
|
||||
export ueberzug_pid_file="$joshuto_wrap_tmp/pid"
|
||||
export ueberzug_img_identifier="preview"
|
||||
export ueberzug_socket=""
|
||||
export ueberzug_pid=""
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function start_ueberzugpp {
|
||||
## Adapt Überzug++ options here. For example, remove the '--no-opencv' or set another output method.
|
||||
ueberzug layer --no-stdin --pid-file "$ueberzug_pid_file" --no-opencv &>/dev/null
|
||||
ueberzug_pid="$(cat "$ueberzug_pid_file")"
|
||||
export ueberzug_pid
|
||||
export ueberzug_socket=/tmp/ueberzugpp-"$ueberzug_pid".socket
|
||||
mkdir -p "$joshuto_wrap_preview_meta"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function stop_ueberzugpp {
|
||||
remove_image
|
||||
ueberzug cmd -s "$ueberzug_socket" -a exit
|
||||
kill "$ueberzug_pid"
|
||||
rm -rf "$joshuto_wrap_tmp"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function show_image {
|
||||
ueberzug cmd -s "$ueberzug_socket" -a add -i "$ueberzug_img_identifier" -x "$2" -y "$3" --max-width "$4" --max-height "$5" -f "$1" &>/dev/null
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function remove_image {
|
||||
ueberzug cmd -s "$ueberzug_socket" -a remove -i "$ueberzug_img_identifier" &>/dev/null
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function get_preview_meta_file {
|
||||
echo "$joshuto_wrap_preview_meta/$(echo "$1" | md5sum | sed 's/ //g')"
|
||||
}
|
||||
|
||||
export -f get_preview_meta_file
|
||||
export -f show_image
|
||||
export -f remove_image
|
||||
|
||||
if [ -n "$DISPLAY" ] && command -v ueberzug > /dev/null; then
|
||||
trap stop_ueberzugpp EXIT QUIT INT TERM
|
||||
start_ueberzugpp
|
||||
fi
|
||||
|
||||
joshuto "$@"
|
||||
exit $?
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
|
|
@ -9,18 +9,26 @@ in {
|
|||
home-manager.users.${config.user.name} = { config, ... }: {
|
||||
services.flameshot = {
|
||||
enable = true;
|
||||
package = pkgs.flameshot.overrideAttrs (old: {
|
||||
src = inputs.flameshot-git;
|
||||
cmakeFlags = [ "-DUSE_WAYLAND_GRIM=1" ];
|
||||
});
|
||||
settings = {
|
||||
General = {
|
||||
showStartupLaunchMessage = false;
|
||||
disabledTrayIcon = true;
|
||||
showHelp = false;
|
||||
showDesktopNotification = false;
|
||||
filenamePattern = "%F_%T";
|
||||
savePath = "${config.home.homeDirectory}/Pictures/Screenshots";
|
||||
savePathFixed = true;
|
||||
saveAfterCopy = true;
|
||||
uiColor = "#83A598";
|
||||
};
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs.unstable; [ grim ];
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
381
modules/desktop/hyprland.nix
Normal file
381
modules/desktop/hyprland.nix
Normal file
|
|
@ -0,0 +1,381 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
term = "${pkgs.alacritty}/bin/alacritty";
|
||||
in {
|
||||
options.modules.desktop.hyprland = { enable = mkBoolOpt false; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
modules = {
|
||||
desktop = {
|
||||
themes = {
|
||||
gtk.enable = true;
|
||||
qt.enable = true;
|
||||
};
|
||||
alacritty.enable = true;
|
||||
file-manager.enable = true;
|
||||
zsh.enable = true;
|
||||
vscode.enable = true;
|
||||
dunst.enable = true;
|
||||
htop.enable = true;
|
||||
flameshot.enable = true;
|
||||
};
|
||||
hardware = { audio.enable = true; };
|
||||
apps.rofi.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.${config.user.name} = {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
xwayland.enable = true;
|
||||
settings = {
|
||||
"$mod" = "SUPER";
|
||||
|
||||
env = [ "XCURSOR_SIZE,24" "WLR_NO_HARDWARE_CURSORS,1" ];
|
||||
|
||||
xwayland = { force_zero_scaling = true; };
|
||||
|
||||
general = {
|
||||
layout = "dwindle";
|
||||
gaps_in = 7;
|
||||
gaps_out = 14;
|
||||
border_size = 2;
|
||||
"col.active_border" = "rgb(B28121)";
|
||||
"col.inactive_border" = "rgb(504945)";
|
||||
no_focus_fallback = false;
|
||||
resize_on_border = false;
|
||||
hover_icon_on_border = false;
|
||||
};
|
||||
|
||||
dwindle = { preserve_split = true; };
|
||||
|
||||
input = {
|
||||
kb_layout = "fr";
|
||||
kb_options = "caps:escape";
|
||||
numlock_by_default = "true";
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
disable_while_typing = true;
|
||||
tap-to-click = false;
|
||||
middle_button_emulation = false;
|
||||
};
|
||||
};
|
||||
|
||||
gestures = {
|
||||
workspace_swipe = true;
|
||||
workspace_swipe_fingers = 3;
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
animation = [
|
||||
"windows, 1, 2, default, popin 80%"
|
||||
"windowsOut, 1, 2, default, popin 85%"
|
||||
"windowsMove, 1, 2, default"
|
||||
"workspaces, 1, 2, default"
|
||||
"specialWorkspace, 1, 2, default"
|
||||
];
|
||||
};
|
||||
|
||||
bind = [
|
||||
"$mod, Return, exec, ${term}"
|
||||
"$mod, C, killactive"
|
||||
"$mod SHIFT, Q, exit"
|
||||
"$mod SHIFT, A, exec, ${term} -e pulsemixer"
|
||||
"$mod, W, exec, firefox"
|
||||
"$mod, R, exec, ${term} -e yazi"
|
||||
"$mod, E, exec, emacsclient -c"
|
||||
"$mod, N, exec, emacsclient -c --eval '(elfeed)'"
|
||||
"$mod, I, exec, ${term} -e htop"
|
||||
"$mod, M, exec, ${term} -e ncmpcpp"
|
||||
"$mod, V, exec, ${term} -e ncmpcpp -s visualizer"
|
||||
"$mod, T, togglefloating"
|
||||
"$mod, D, exec, rofi -show drun -show-icons"
|
||||
"$mod SHIFT, P, exec, rofi -show p -modi p:rofi-power-menu"
|
||||
|
||||
# Layout manipulation
|
||||
"$mod SHIFT, O, layoutmsg, togglesplit"
|
||||
"$mod, comma, splitratio, -0.1"
|
||||
"$mod, semicolon, splitratio, +0.1"
|
||||
|
||||
"$mod, F, fullscreen, 0"
|
||||
"$mod, X, exec, swaylock"
|
||||
|
||||
# Move focus
|
||||
"$mod, H, movefocus, l"
|
||||
"$mod, L, movefocus, r"
|
||||
"$mod, K, movefocus, u"
|
||||
"$mod, J, movefocus, d"
|
||||
"$mod, left, movefocus, l"
|
||||
"$mod, right, movefocus, r"
|
||||
"$mod, up, movefocus, u"
|
||||
"$mod, down, movefocus, d"
|
||||
|
||||
# Move window
|
||||
"$mod SHIFT, H, movewindow, l"
|
||||
"$mod SHIFT, L, movewindow, r"
|
||||
"$mod SHIFT, K, movewindow, u"
|
||||
"$mod SHIFT, J, movewindow, d"
|
||||
"$mod SHIFT, left, movewindow, l"
|
||||
"$mod SHIFT, right, movewindow, r"
|
||||
"$mod SHIFT, up, movewindow, u"
|
||||
"$mod SHIFT, down, movewindow, d"
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
"$mod, code:10, moveworkspacetomonitor, 1 current"
|
||||
"$mod, code:10, workspace, 1"
|
||||
"$mod, code:11, moveworkspacetomonitor, 2 current"
|
||||
"$mod, code:11, workspace, 2"
|
||||
"$mod, code:12, moveworkspacetomonitor, 3 current"
|
||||
"$mod, code:12, workspace, 3"
|
||||
"$mod, code:13, moveworkspacetomonitor, 4 current"
|
||||
"$mod, code:13, workspace, 4"
|
||||
"$mod, code:14, moveworkspacetomonitor, 5 current"
|
||||
"$mod, code:14, workspace, 5"
|
||||
"$mod, code:15, moveworkspacetomonitor, 6 current"
|
||||
"$mod, code:15, workspace, 6"
|
||||
"$mod, code:16, moveworkspacetomonitor, 7 current"
|
||||
"$mod, code:16, workspace, 7"
|
||||
"$mod, code:17, moveworkspacetomonitor, 8 current"
|
||||
"$mod, code:17, workspace, 8"
|
||||
"$mod, code:18, moveworkspacetomonitor, 9 current"
|
||||
"$mod, code:18, workspace, 9"
|
||||
"$mod, code:19, moveworkspacetomonitor, 10 current"
|
||||
"$mod, code:19, workspace, 10"
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
"$mod SHIFT, code:10, movetoworkspace, 1"
|
||||
"$mod SHIFT, code:11, movetoworkspace, 2"
|
||||
"$mod SHIFT, code:12, movetoworkspace, 3"
|
||||
"$mod SHIFT, code:13, movetoworkspace, 4"
|
||||
"$mod SHIFT, code:14, movetoworkspace, 5"
|
||||
"$mod SHIFT, code:15, movetoworkspace, 6"
|
||||
"$mod SHIFT, code:16, movetoworkspace, 7"
|
||||
"$mod SHIFT, code:17, movetoworkspace, 8"
|
||||
"$mod SHIFT, code:18, movetoworkspace, 9"
|
||||
"$mod SHIFT, code:19, movetoworkspace, 10"
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
"$mod, mouse_down, workspace, e-1"
|
||||
"$mod, mouse_up, workspace, e+1"
|
||||
|
||||
# Media controls
|
||||
", XF86AudioRaiseVolume, exec, pulsemixer --change-volume +1"
|
||||
", XF86AudioLowerVolume, exec, pulsemixer --change-volume -1"
|
||||
# ", XF86AudioMicMute, exec, pulsemixer --toggle-mute"
|
||||
", XF86AudioMute, exec, pulsemixer --toggle-mute"
|
||||
", XF86AudioPlay, exec, mpc toggle"
|
||||
", XF86AudioPause, exec, mpc toggle"
|
||||
", XF86AudioNext, exec, mpc next"
|
||||
", XF86AudioPrev, exec, mpc prev"
|
||||
"$mod, P, exec, mpc toggle"
|
||||
|
||||
", XF86MonBrightnessDown, exec, light -U 5"
|
||||
", XF86MonBrightnessUp, exec, light -A 5"
|
||||
|
||||
", Print, exec, flameshot full"
|
||||
"SHIFT , Print, exec, env QT_SCREEN_SCALE_FACTORS=0.66666666 flameshot gui"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"${pkgs.swaybg}/bin/swaybg --image ${config.modules.desktop.wallpaper} --mode fill"
|
||||
"keepassxc"
|
||||
];
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = 0;
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
animate_manual_resizes = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "bottom";
|
||||
height = 25;
|
||||
spacing = 2;
|
||||
reload-style-on-change = true;
|
||||
modules-left = [ "cpu" "memory" "disk" "hyprland/window" ];
|
||||
modules-center = [ "hyprland/workspaces" ];
|
||||
modules-right = [ "mpd" "battery" "clock" "tray" ];
|
||||
|
||||
tray = {
|
||||
icon-size = 14;
|
||||
spacing = 5;
|
||||
show-passive-items = true;
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 1;
|
||||
format = " {usage}%";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 1;
|
||||
format = " {percentage}%";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
disk = {
|
||||
interval = 60;
|
||||
format = " {free}";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
clock = {
|
||||
format = " {:%A, %d %h %H:%M}";
|
||||
format-alt = " {:%d/%m/%Y %H:%M}";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
font-family: MesloLGS Nerd Font;
|
||||
font-size: 12px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: #282828;
|
||||
border: 0px solid;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: #282828;
|
||||
color: #ebdbb2;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 0.6em;
|
||||
color: #a89984;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #ebdbb2;
|
||||
background: #665c54;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #1d2021;
|
||||
background: #fb4934;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: #665c54;
|
||||
}
|
||||
|
||||
#network,
|
||||
#workspaces,
|
||||
#bluetooth,
|
||||
#tray {
|
||||
color: #ebdbb2;
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
#cpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#clock {
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
color: #83a598;
|
||||
}
|
||||
'';
|
||||
package = pkgs.waybar.override { wireplumberSupport = false; };
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with pkgs.unstable; [ wlr-randr wl-clipboard wdisplays ];
|
||||
};
|
||||
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.swaylock-effects;
|
||||
|
||||
settings = {
|
||||
ignore-empty-password = true;
|
||||
daemonize = true;
|
||||
# fade-in = 0.5;
|
||||
indicator = true;
|
||||
clock = true;
|
||||
datestr = "%d/%m/%Y";
|
||||
screenshots = true;
|
||||
hide-keyboard-layout = true;
|
||||
indicator-caps-lock = true;
|
||||
bs-hl-color = "7daea3cc";
|
||||
caps-lock-bs-hl-color = "7daea3cc";
|
||||
caps-lock-key-hl-color = "d3869bcc";
|
||||
font = "MesloLGS Nerd Font Propo";
|
||||
font-size = "35";
|
||||
indicator-idle-visible = true;
|
||||
indicator-radius = 100;
|
||||
indicator-thickness = 7;
|
||||
inside-color = "32302f66";
|
||||
inside-clear-color = "89b48266";
|
||||
inside-caps-lock-color = "e78a4e66";
|
||||
inside-ver-color = "7daea366";
|
||||
inside-wrong-color = "ea696266";
|
||||
key-hl-color = "a9b665cc";
|
||||
layout-bg-color = "32302f00";
|
||||
layout-text-color = "d4be98";
|
||||
line-color = "00000000";
|
||||
ring-color = "e78a4ecc";
|
||||
ring-clear-color = "89b482cc";
|
||||
ring-caps-lock-color = "e78a4ecc";
|
||||
ring-ver-color = "7daea3cc";
|
||||
ring-wrong-color = "ea6962cc";
|
||||
separator-color = "00000000";
|
||||
text-color = "d4be98";
|
||||
text-clear-color = "d4be98";
|
||||
text-caps-lock-color = "d4be98";
|
||||
text-ver-color = "d4be98";
|
||||
text-wrong-color = "d4be98";
|
||||
effect-blur = "9x9";
|
||||
effect-greyscale = true;
|
||||
# effect-vignette = "0.5:0.5";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
config.preferred = {
|
||||
default = "gtk";
|
||||
"org.freedesktop.impl.portal.Screencast" = "hyprland";
|
||||
};
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-hyprland
|
||||
];
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
};
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let cfg = config.modules.desktop.joshuto;
|
||||
in {
|
||||
options.modules.desktop.joshuto = { enable = mkBoolOpt false; };
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${config.user.name} = {
|
||||
programs.joshuto = {
|
||||
enable = true;
|
||||
package = with pkgs;
|
||||
writeShellApplication {
|
||||
name = "joshuto";
|
||||
runtimeInputs = [ ueberzugpp joshuto trash-cli xclip fzf ];
|
||||
text = builtins.readFile ./files/joshuto_wrapper.sh;
|
||||
};
|
||||
settings = {
|
||||
xdg_open = true;
|
||||
xdg_open_fork = true;
|
||||
display = { show_icons = true; };
|
||||
preview.max_preview_size = 50 * 1024 * 1024;
|
||||
preview.preview_script = with pkgs;
|
||||
"${
|
||||
writeShellApplication {
|
||||
name = "joshuto-preview";
|
||||
runtimeInputs = [
|
||||
file
|
||||
catdoc
|
||||
pandoc
|
||||
mu
|
||||
djvulibre
|
||||
exiftool
|
||||
mediainfo
|
||||
atool
|
||||
gnutar
|
||||
poppler_utils
|
||||
libtransmission
|
||||
w3m
|
||||
];
|
||||
text = builtins.readFile ./files/joshuto_preview_file.sh;
|
||||
}
|
||||
}/bin/joshuto-preview";
|
||||
preview.preview_shown_hook_script = with pkgs;
|
||||
writeScript "on_preview_shown" ''
|
||||
#!/usr/bin/env bash
|
||||
test -z "$joshuto_wrap_id" && exit 1;
|
||||
|
||||
path="$1" # Full path of the previewed file
|
||||
x="$2" # x coordinate of upper left cell of preview area
|
||||
y="$3" # y coordinate of upper left cell of preview area
|
||||
width="$4" # Width of the preview pane (number of fitting characters)
|
||||
height="$5" # Height of the preview pane (number of fitting characters)
|
||||
|
||||
# Find out mimetype and extension
|
||||
mimetype=$(${file}/bin/file --mime-type -Lb "$path")
|
||||
extension=$(echo "''${path##*.}" | awk '{print tolower($0)}')
|
||||
|
||||
case "$mimetype" in
|
||||
image/png | image/jpeg)
|
||||
show_image "$path" $x $y $width $height
|
||||
;;
|
||||
*)
|
||||
remove_image
|
||||
|
||||
esac
|
||||
'';
|
||||
preview.preview_removed_hook_script =
|
||||
pkgs.writeScript "on_preview_removed" ''
|
||||
#!/usr/bin/env bash
|
||||
test -z "$joshuto_wrap_id" && exit 1;
|
||||
remove_image'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
{ inputs, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let cfg = config.modules.desktop.picom;
|
||||
in {
|
||||
options.modules.desktop.picom = { enable = mkBoolOpt false; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${config.user.name} = {
|
||||
services.picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
vSync = true;
|
||||
opacityRules = [
|
||||
# "100:class_g = 'Firefox'"
|
||||
# Art/image programs where we need fidelity
|
||||
"100:class_g = 'Gimp'"
|
||||
"100:class_g = 'Inkscape'"
|
||||
"100:class_g = 'aseprite'"
|
||||
"100:class_g = 'krita'"
|
||||
"100:class_g = 'feh'"
|
||||
"100:class_g = 'mpv'"
|
||||
"100:class_g = 'Rofi'"
|
||||
"100:class_g = 'Peek'"
|
||||
"99:_NET_WM_STATE@:32a = '_NET_WM_STATE_FULLSCREEN'"
|
||||
];
|
||||
shadowExclude = [
|
||||
# Put shadows on notifications, the scratch popup and rofi only
|
||||
"! name~='(rofi|scratch|Dunst)$'"
|
||||
];
|
||||
|
||||
fade = true;
|
||||
fadeDelta = 1;
|
||||
fadeSteps = [ 1.0e-2 1.2e-2 ];
|
||||
shadow = true;
|
||||
shadowOffsets = [ (-10) (-10) ];
|
||||
shadowOpacity = 0.22;
|
||||
# activeOpacity = "1.00";
|
||||
# inactiveOpacity = "0.92";
|
||||
#
|
||||
settings = {
|
||||
blur-background-exclude = [
|
||||
"window_type = 'dock'"
|
||||
"window_type = 'desktop'"
|
||||
"class_g = 'Rofi'"
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
|
||||
# Unredirect all windows if a full-screen opaque window is detected, to
|
||||
# maximize performance for full-screen windows. Known to cause
|
||||
# flickering when redirecting/unredirecting windows.
|
||||
unredir-if-possible = true;
|
||||
|
||||
# GLX backend: Avoid using stencil buffer, useful if you don't have a
|
||||
# stencil buffer. Might cause incorrect opacity when rendering
|
||||
# transparent content (but never practically happened) and may not work
|
||||
# with blur-background. My tests show a 15% performance boost.
|
||||
# Recommended.
|
||||
glx-no-stencil = true;
|
||||
|
||||
# Use X Sync fence to sync clients' draw calls, to make sure all draw
|
||||
# calls are finished before picom starts drawing. Needed on
|
||||
# nvidia-drivers with GLX backend for some users.
|
||||
xrender-sync-fence = true;
|
||||
|
||||
shadow-radius = 12;
|
||||
# blur-background = true;
|
||||
# blur-background-frame = true;
|
||||
# blur-background-fixed = true;
|
||||
blur-kern = "7x7box";
|
||||
blur-strength = 320;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,279 +0,0 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
|
||||
let cfg = config.modules.desktop.polybar;
|
||||
in {
|
||||
options.modules.desktop.polybar = { enable = mkBoolOpt false; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home-manager.users.${config.user.name} = {
|
||||
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.polybar.override {
|
||||
pulseSupport = true;
|
||||
mpdSupport = true;
|
||||
};
|
||||
|
||||
script = ''
|
||||
export MONITOR=$(polybar -m|tail -1|sed -e 's/:.*$//g')
|
||||
|
||||
polybar main &
|
||||
'';
|
||||
|
||||
settings = {
|
||||
"colors" = {
|
||||
bg = "#282828";
|
||||
bg-alt = "#3c3836";
|
||||
bg-darker = "#1d2021";
|
||||
fg = "#fbf1c7";
|
||||
fg-alt = "#928374";
|
||||
|
||||
blue = "#83a598";
|
||||
cyan = "#8ec07c";
|
||||
green = "#b8bb26";
|
||||
orange = "#fe8019";
|
||||
purple = "#d3869b";
|
||||
red = "#fb4934";
|
||||
yellow = "#fabd2f";
|
||||
|
||||
bg-blue = "#458588";
|
||||
bg-cyan = "#689d6a";
|
||||
bg-green = "#98971a";
|
||||
bg-orange = "#d65d0e";
|
||||
bg-purple = "#b16268";
|
||||
bg-red = "#cc241d";
|
||||
bg-yellow = "#d79921";
|
||||
|
||||
black = "#000";
|
||||
white = "#FFF";
|
||||
|
||||
trans = "#00000000";
|
||||
semi-trans = "#ee282828";
|
||||
semi-trans-black = "#aa000000";
|
||||
accent = "#83a598";
|
||||
};
|
||||
"global/wm" = {
|
||||
margin-top = 0;
|
||||
margin-bottom = 34;
|
||||
};
|
||||
"bar/main" = {
|
||||
monitor = "\${env:MONITOR}";
|
||||
background = "\${colors.bg}";
|
||||
foreground = "\${colors.fg}";
|
||||
enable-ipc = true;
|
||||
|
||||
width = "100%";
|
||||
height = "34";
|
||||
bottom = true;
|
||||
|
||||
padding = 2;
|
||||
|
||||
font-0 = "MesloLGS Nerd Font Mono:pixelsize=12;3";
|
||||
font-1 = "MesloLGS Nerd Font Mono:pixelsize=20;5";
|
||||
|
||||
modules-left = "pulseaudio cpu memory fs xwindow";
|
||||
modules-center = "ewmh";
|
||||
modules-right = "mpd battery date";
|
||||
|
||||
separator = " ";
|
||||
|
||||
tray-position = "right";
|
||||
};
|
||||
"module/ewmh" = {
|
||||
type = "internal/xworkspaces";
|
||||
pin-workspaces = false;
|
||||
enable-click = false;
|
||||
enable-scroll = false;
|
||||
|
||||
label-active = "%name%";
|
||||
label-active-background = "\${colors.bg-alt}";
|
||||
label-active-foreground = "\${colors.fg}";
|
||||
label-active-padding = 1;
|
||||
|
||||
label-occupied = "%name%";
|
||||
label-occupied-foreground = "\${colors.accent}";
|
||||
label-occupied-padding = 1;
|
||||
|
||||
label-urgent-foreground = "\${colors.red}";
|
||||
label-urgent-padding = 1;
|
||||
|
||||
label-empty = "%name%";
|
||||
label-empty-foreground = "\${colors.fg-alt}";
|
||||
label-empty-padding = 1;
|
||||
};
|
||||
"module/date" = {
|
||||
type = "internal/date";
|
||||
interval = 5;
|
||||
|
||||
label = "%date% %time%";
|
||||
date = "%A, %d %h";
|
||||
date-alt = "%d/%m/%Y";
|
||||
time = "%H:%M";
|
||||
time-alt = "%H:%M";
|
||||
format-foreground = "\${colors.accent}";
|
||||
format-prefix = "";
|
||||
format-prefix-font = 2;
|
||||
format-prefix-padding = 1;
|
||||
format-prefix-foreground = "\${colors.accent}";
|
||||
};
|
||||
"module/xwindow" = {
|
||||
type = "internal/xwindow";
|
||||
label = "%title:0:80:...%";
|
||||
label-padding-left = 2;
|
||||
|
||||
};
|
||||
"module/fs" = {
|
||||
type = "internal/fs";
|
||||
mount-0 = "/";
|
||||
interval = 30;
|
||||
format-mounted = "<label-mounted>";
|
||||
label-mounted = "%used% of %total%";
|
||||
format-mounted-prefix = "";
|
||||
format-mounted-prefix-padding = 1;
|
||||
format-mounted-prefix-font = 2;
|
||||
format-mounted-foreground = "\${colors.accent}";
|
||||
|
||||
format-unmounted = "";
|
||||
label-unmounted = "";
|
||||
label-unmounted-foreground = "\${colors.fg-alt}";
|
||||
|
||||
bar-used-indicator = "";
|
||||
bar-used-width = 10;
|
||||
bar-used-foreground-0 = "\${colors.fg}";
|
||||
bar-used-foreground-1 = "\${colors.fg}";
|
||||
bar-used-foreground-2 = "\${colors.fg}";
|
||||
bar-used-foreground-3 = "\${colors.fg}";
|
||||
bar-used-foreground-4 = "\${colors.fg}";
|
||||
bar-used-foreground-5 = "\${colors.yellow}";
|
||||
bar-used-foreground-6 = "\${colors.yellow}";
|
||||
bar-used-foreground-7 = "\${colors.yellow}";
|
||||
bar-used-foreground-8 = "\${colors.red}";
|
||||
bar-used-fill = "|";
|
||||
bar-used-empty = "¦";
|
||||
bar-used-empty-foreground = "\${colors.fg-alt}";
|
||||
};
|
||||
"module/cpu" = {
|
||||
type = "internal/cpu";
|
||||
interval = 2;
|
||||
format = "<bar-load>";
|
||||
format-prefix = "";
|
||||
format-prefix-padding = 1;
|
||||
format-prefix-font = 2;
|
||||
format-foreground = "\${colors.accent}";
|
||||
|
||||
bar-load-indicator = "";
|
||||
bar-load-width = 10;
|
||||
bar-load-foreground-0 = "\${colors.fg}";
|
||||
bar-load-foreground-1 = "\${colors.fg}";
|
||||
bar-load-foreground-2 = "\${colors.fg}";
|
||||
bar-load-foreground-3 = "\${colors.fg}";
|
||||
bar-load-foreground-4 = "\${colors.fg}";
|
||||
bar-load-foreground-5 = "\${colors.yellow}";
|
||||
bar-load-foreground-6 = "\${colors.yellow}";
|
||||
bar-load-foreground-7 = "\${colors.yellow}";
|
||||
bar-load-foreground-8 = "\${colors.red}";
|
||||
bar-load-fill = "|";
|
||||
bar-load-empty = "¦";
|
||||
bar-load-empty-foreground = "\${colors.fg-alt}";
|
||||
};
|
||||
"module/memory" = {
|
||||
type = "internal/memory";
|
||||
interval = 3;
|
||||
format = "<bar-used>";
|
||||
format-prefix = "";
|
||||
format-prefix-padding = 1;
|
||||
format-prefix-font = 2;
|
||||
format-prefix-foreground = "\${colors.accent}";
|
||||
|
||||
bar-used-indicator = "";
|
||||
bar-used-width = 10;
|
||||
bar-used-foreground-0 = "\${colors.fg}";
|
||||
bar-used-foreground-1 = "\${colors.fg}";
|
||||
bar-used-foreground-2 = "\${colors.fg}";
|
||||
bar-used-foreground-3 = "\${colors.fg}";
|
||||
bar-used-foreground-4 = "\${colors.fg}";
|
||||
bar-used-foreground-5 = "\${colors.yellow}";
|
||||
bar-used-foreground-6 = "\${colors.yellow}";
|
||||
bar-used-foreground-7 = "\${colors.yellow}";
|
||||
bar-used-foreground-8 = "\${colors.red}";
|
||||
bar-used-fill = "|";
|
||||
bar-used-empty = "¦";
|
||||
bar-used-empty-foreground = "\${colors.fg-alt}";
|
||||
};
|
||||
"module/pulseaudio" = {
|
||||
type = "internal/pulseaudio";
|
||||
|
||||
format-volume = "<ramp-volume> <bar-volume>";
|
||||
label-volume-foreground = "\${colors.accent}";
|
||||
|
||||
label-muted = "";
|
||||
label-muted-font = 2;
|
||||
format-muted-foreground = "\${colors.red}";
|
||||
format-muted = "<label-muted>";
|
||||
|
||||
bar-volume-width = 8;
|
||||
bar-volume-gradient = false;
|
||||
bar-volume-indicator = "|";
|
||||
bar-volume-indicator-foreground = "#ff";
|
||||
bar-volume-fill = "─";
|
||||
bar-volume-empty = "─";
|
||||
bar-volume-empty-foreground = "\${colors.fg-alt}";
|
||||
|
||||
ramp-volume-0 = "";
|
||||
ramp-volume-1 = "";
|
||||
ramp-volume-2 = "";
|
||||
ramp-volume-font = 2;
|
||||
};
|
||||
"module/mpd" = (mkIf config.modules.media.mpd.enable {
|
||||
type = "internal/mpd";
|
||||
host = "127.0.0.1";
|
||||
port = "6600";
|
||||
|
||||
label-song = "%artist% - %title%";
|
||||
format-playing-prefix = "";
|
||||
format-playing-prefix-padding = 1;
|
||||
format-playing-prefix-font = 2;
|
||||
format-playing-foreground = "\${colors.fg}";
|
||||
format-paused-prefix = "";
|
||||
format-paused-prefix-padding = 1;
|
||||
format-paused-prefix-font = 2;
|
||||
format-paused-foreground = "\${colors.fg-alt}";
|
||||
});
|
||||
"module/battery" = {
|
||||
type = "internal/battery";
|
||||
battery = "BAT0";
|
||||
adapter = "AC";
|
||||
|
||||
format-charging = "<animation-charging> <label-charging>";
|
||||
format-discharging = "<ramp-capacity> <label-discharging>";
|
||||
|
||||
ramp-capacity-0 = "";
|
||||
ramp-capacity-1 = "";
|
||||
ramp-capacity-2 = "";
|
||||
ramp-capacity-3 = "";
|
||||
ramp-capacity-4 = "";
|
||||
|
||||
ramp-capacity-font = 2;
|
||||
|
||||
ramp-capacity-0-foreground = "\${colors.red}";
|
||||
ramp-capacity-1-foreground = "\${colors.yellow}";
|
||||
ramp-capacity-2-foreground = "\${colors.fg-alt}";
|
||||
|
||||
animation-charging-0 = "";
|
||||
animation-charging-1 = "";
|
||||
animation-charging-2 = "";
|
||||
animation-charging-3 = "";
|
||||
animation-charging-4 = "";
|
||||
|
||||
animation-charging-font = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,37 +2,12 @@
|
|||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let
|
||||
cfg = config.modules.desktop.themes.qt;
|
||||
|
||||
sddmBackground = pkgs.fetchurl {
|
||||
url =
|
||||
"https://raw.githubusercontent.com/AngelJumbo/gruvbox-wallpapers/main/wallpapers/irl/mountains2.jpg";
|
||||
sha256 = "sha256-hp9cxCpZsDYKxUUSuec2wZyv9/N93Cw6ENTHGxKap9Q=";
|
||||
};
|
||||
|
||||
sddmTheme = pkgs.stdenv.mkDerivation {
|
||||
name = "sddm-theme";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "MarianArlt";
|
||||
repo = "sddm-sugar-dark";
|
||||
rev = "ceb2c455663429be03ba62d9f898c571650ef7fe";
|
||||
sha256 = "0153z1kylbhc9d12nxy9vpn0spxgrhgy36wy37pk6ysq7akaqlvy";
|
||||
};
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -R ./* $out/
|
||||
cd $out/
|
||||
rm Background.jpg
|
||||
cp -r ${sddmBackground} $out/Background.jpg
|
||||
'';
|
||||
};
|
||||
let cfg = config.modules.desktop.themes.qt;
|
||||
|
||||
in {
|
||||
options.modules.desktop.themes.qt = { enable = mkBoolOpt false; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver.displayManager.sddm.theme = "${sddmTheme}";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 15 MiB |
|
|
@ -1,131 +0,0 @@
|
|||
import System.Exit
|
||||
import Data.Maybe (Maybe, isNothing, fromJust)
|
||||
import qualified Data.List as L
|
||||
import qualified Data.Map as M
|
||||
import GHC.IO.Handle
|
||||
-- Xmonad Core
|
||||
import XMonad
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Config.Desktop
|
||||
import XMonad.Config.Azerty
|
||||
|
||||
-- Layouts
|
||||
import XMonad.Layout.LayoutModifier
|
||||
import XMonad.Layout.Gaps
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.MultiToggle
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.MultiToggle.Instances
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.BinarySpacePartition
|
||||
import XMonad.Layout.SimpleFloat
|
||||
import XMonad.Layout.PerWorkspace (onWorkspace)
|
||||
import XMonad.Layout.Minimize
|
||||
import XMonad.Layout.Fullscreen
|
||||
|
||||
-- Actions
|
||||
import XMonad.Actions.Navigation2D
|
||||
import XMonad.Actions.GridSelect
|
||||
import XMonad.Actions.UpdatePointer
|
||||
import XMonad.Actions.SpawnOn
|
||||
import XMonad.Actions.CycleWS
|
||||
|
||||
-- Hooks
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.SetWMName
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.ManageDocks
|
||||
|
||||
-- Utils
|
||||
import XMonad.Util.NamedScratchpad
|
||||
import XMonad.Util.WorkspaceCompare
|
||||
import XMonad.Util.Run
|
||||
import XMonad.Util.EZConfig
|
||||
|
||||
myTerminal = "alacritty"
|
||||
mySelectScreenshot = "scrot -s"
|
||||
myScreenshot = "scrot"
|
||||
|
||||
myWorkspaces = ["1","2","3","4","5","6"] ++ map show [7..9]
|
||||
myModMask = mod4Mask
|
||||
|
||||
myFocusFollowsMouse :: Bool
|
||||
myFocusFollowsMouse = True
|
||||
|
||||
main = do
|
||||
xmonad $ ewmh . docks $ myConfig
|
||||
|
||||
myConfig = azertyConfig {
|
||||
terminal = myTerminal,
|
||||
focusFollowsMouse = True,
|
||||
borderWidth = 1,
|
||||
modMask = mod4Mask,
|
||||
workspaces = myWorkspaces,
|
||||
normalBorderColor = "#474646",
|
||||
focusedBorderColor = "#83a598",
|
||||
layoutHook = myLayout,
|
||||
manageHook = manageDocks <+> (isFullscreen --> doFullFloat) <+> manageHook def,
|
||||
--handleEventHook = myEventHook <+> handleEventHook def,
|
||||
logHook = logHook def,
|
||||
--keys = \c -> mkKeymap c myAdditionalKeys,
|
||||
startupHook = myStartupHook
|
||||
} `removeKeysP` myRemoveKeys `additionalKeysP` myAdditionalKeys
|
||||
|
||||
myRemoveKeys = [
|
||||
]
|
||||
|
||||
myAdditionalKeys = [
|
||||
("M-q", kill),
|
||||
("M-x", spawn "i3lock -e -f -c 000000 -i ~/.wallpaper.jpg"),
|
||||
("M-S-h", sendMessage (IncMasterN 1)),
|
||||
("M-S-l", sendMessage (IncMasterN (-1))),
|
||||
("M-S-<Return>", windows W.swapMaster),
|
||||
("M-d", spawn "rofi -show drun -show-icons"),
|
||||
("M-s", spawn "rofi -show ssh"),
|
||||
("M-w", spawn "firefox"),
|
||||
("M-i", spawn $ myTerminal ++ " -e htop"),
|
||||
("M-e", spawn "emacsclient -c"),
|
||||
("M-r", spawn $ myTerminal ++ " -e joshuto"),
|
||||
("M-y", spawn $ myTerminal ++ " -e calcurse"),
|
||||
("M-v", spawn $ myTerminal ++ " -e ncmpcpp -s visualizer"),
|
||||
("M-m", spawn $ myTerminal ++ " -e ncmpcpp"),
|
||||
("M-n", spawn "emacsclient -c --eval '(elfeed)'"),
|
||||
("M-c", spawn "rofi -show calc -modi calc -no-show-match -no-sort"),
|
||||
("<Print>", spawn "scrot -e 'mv $f ~/Pictures/Screenshots'"),
|
||||
("S-<Print>", spawn "flameshot gui"),
|
||||
("M-S-a", spawn $ myTerminal ++ " -e pulsemixer"),
|
||||
("M-S-p", spawn "rofi -show p -modi p:rofi-power-menu"),
|
||||
("M-<Return>", spawn myTerminal),
|
||||
("M-f", sendMessage $ Toggle FULL),
|
||||
-- Switch workspaces and screens
|
||||
--("M-<Right>", moveTo Next (WSIs hiddenNotNSP)),
|
||||
--("M-<Left>", moveTo Prev (WSIs hiddenNotNSP)),
|
||||
--("M-S-<Right>", shiftTo Next (WSIs hiddenNotNSP)),
|
||||
--("M-S-<Left>", shiftTo Prev (WSIs hiddenNotNSP)),
|
||||
("M-<Down>", nextScreen),
|
||||
("M-<Up>", prevScreen),
|
||||
("M-S-<Down>", shiftNextScreen),
|
||||
("M-S-<Up>", shiftPrevScreen),
|
||||
("M-S-r", spawn "xmonad --recompile; xmonad --restart"),
|
||||
("<XF86AudioLowerVolume>" ,spawn "pulsemixer --change-volume -1"),
|
||||
("<XF86AudioRaiseVolume>" ,spawn "pulsemixer --change-volume +1"),
|
||||
("<XF86AudioMute>" ,spawn "pulsemixer --toggle-mute"),
|
||||
("<XF86MonBrightnessDown>" ,spawn "light -U 5"),
|
||||
("<XF86MonBrightnessUp>" ,spawn "light -A 5"),
|
||||
("<XF86AudioPlay>" ,spawn "mpc toggle"),
|
||||
("M-p" ,spawn "mpc toggle"),
|
||||
("<XF86AudioPrev>" ,spawn "mpc prev"),
|
||||
("<XF86AudioNext>" ,spawn "mpc next"),
|
||||
("<XF86Sleep>" ,spawn "systemctl suspend")
|
||||
]
|
||||
|
||||
myLayout = smartSpacing 5
|
||||
$ smartBorders
|
||||
$ mkToggle (NOBORDERS ?? FULL ?? EOT)
|
||||
$ avoidStruts
|
||||
$ layoutHook def
|
||||
|
||||
myStartupHook = do
|
||||
setWMName "LG3D"
|
||||
return () >> checkKeymap myConfig myAdditionalKeys
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
|
||||
let cfg = config.modules.desktop.xmonad;
|
||||
in {
|
||||
options.modules.desktop.xmonad = { enable = mkBoolOpt false; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
modules = {
|
||||
desktop = {
|
||||
polybar.enable = true;
|
||||
picom.enable = true;
|
||||
themes = {
|
||||
gtk.enable = true;
|
||||
qt.enable = true;
|
||||
};
|
||||
};
|
||||
apps.rofi.enable = true;
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
layout = "fr";
|
||||
autoRepeatDelay = 400;
|
||||
autoRepeatInterval = 25;
|
||||
desktopManager.xterm.enable = false;
|
||||
windowManager.xmonad.enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
|
||||
};
|
||||
|
||||
home-manager.users.${config.user.name} = {
|
||||
xsession = {
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
config = ./xmonad.hs;
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with pkgs.unstable; [
|
||||
i3lock
|
||||
|
||||
feh
|
||||
scrot
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue