From c81070da922663b9562887e5376596f67bdc8005 Mon Sep 17 00:00:00 2001 From: dadada Date: Mon, 27 Apr 2020 21:43:16 +0200 Subject: [PATCH] Port to 20.03 --- colors.nix | 2 +- common.nix | 1 + fish.nix | 36 ++++++++++++++++++------------------ gtk.nix | 2 +- metis.nix | 11 ++++------- sway/config | 33 ++++++++++++++++++++++++++++----- sway/default.nix | 30 ++++++++++++++++++++++++++++++ vim/default.nix | 11 +++++++++++ vim/vimrc | 4 ++-- 9 files changed, 96 insertions(+), 34 deletions(-) create mode 100644 sway/default.nix diff --git a/colors.nix b/colors.nix index aaa03e8..5d264cf 100644 --- a/colors.nix +++ b/colors.nix @@ -3,7 +3,7 @@ foregroundBold = "#e8e8e8"; cursor = "#e8e8e8"; cursorForeground = "#1f2022"; - background = "#1f2022"; + background = "#292b2e"; color0 = "#1f2022"; color8 = "#585858"; color7 = "#a3a3a3"; diff --git a/common.nix b/common.nix index 42a5a25..bc32d94 100644 --- a/common.nix +++ b/common.nix @@ -14,5 +14,6 @@ ./git.nix ./gtk.nix ./xdg.nix + ./sway ]; } diff --git a/fish.nix b/fish.nix index 86fbf18..d00d86f 100644 --- a/fish.nix +++ b/fish.nix @@ -1,18 +1,18 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { programs.fish = { enable = true; - # plugins = [ - # { - # name = "fzf"; - # src = pkgs.fetchFromGithub { - # owner = "jethrokuan"; - # repo = "fzf"; - # rev = "7f4c0b6d9545126a1bdf30279e6b1ab6ffedc299"; - # sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh"; - # }; - # } - # ]; + plugins = with pkgs; [ + { + name = "fzf"; + src = pkgs.fetchFromGitHub { + owner = "jethrokuan"; + repo = "fzf"; + rev = "c3defd4a922e97120503b45e26efa775bc672b50"; + sha256 = "1k5b0nva0mbqc9830qhbcwxsi8d9b2p4ws1fq0bw9nkf2ripyp4p"; + }; + } + ]; interactiveShellInit = '' # fish git prompt set __fish_git_prompt_show_informative_status 'yes' @@ -30,12 +30,12 @@ set -U FZF_LEGACY_KEYBINDINGS 0 #set -x TERM xterm-256color - if status is-interactive - and not status is-login - and not set -q TMUX - and string match -qr "^xterm-.*" "$TERM" - exec tmux - end + #if status is-interactive + #and not status is-login + #and not set -q TMUX + #and string match -qr "^xterm-.*" "$TERM" + # exec tmux + #end ''; promptInit = '' function fish_prompt diff --git a/gtk.nix b/gtk.nix index 1286deb..1a102c4 100644 --- a/gtk.nix +++ b/gtk.nix @@ -14,6 +14,6 @@ }; qt = { enable = true; - platformTheme = "gnome"; + platformTheme = "gtk"; }; } diff --git a/metis.nix b/metis.nix index 56c5f55..56b822b 100644 --- a/metis.nix +++ b/metis.nix @@ -6,7 +6,7 @@ let MAILDIR = "\$HOME/.var/mail"; MBLAZE = "\$HOME/.config/mblaze"; NOTMUCH_CONFIG = "\$HOME/.config/notmuch/config"; - GDK_BACKEND= "wayland"; + GDK_BACKEND= "x11"; MOZ_ENABLE_WAYLAND= "1"; SSH_ASKPASS = "${pkgs.lxqt.lxqt-openssh-askpass}/bin/lxqt-openssh-askpass"; }; @@ -25,6 +25,7 @@ in systemd.user.sessionVariables = userEnv; home.packages = with pkgs; [ + xwayland slurp grim jq @@ -78,20 +79,16 @@ in texlive-tubslatex openssl audio-recorder - qt59.qttools + qt5.qttools emacs ] ++ (with unstable; [ python38Packages.managesieve android-studio cachix keepassxc + signal-desktop ]); - #wayland.windowManager.sway = { - # enable = true; - # extraConfig = (builtins.readFile sway/config); - #}; - services.syncthing = { enable = true; tray = false; diff --git a/sway/config b/sway/config index f0f671c..e0da902 100644 --- a/sway/config +++ b/sway/config @@ -18,7 +18,7 @@ set $light_cyan #4f97d7ff set $dark_white #a31db1ff set $light_white #b03060ff -#xwayland disable +xwayland enable # global modifier key set $mod Mod4 @@ -70,6 +70,9 @@ default_border pixel 1 # keep focus within current container? focus_wrapping no +# focus goes to window if mouse is moved onto it +focus_follows_mouse yes + # enter fullscreen mode for the focused container bindsym $mod+o fullscreen @@ -98,11 +101,20 @@ set $9 9 set $10 10 # default mode -#workspace_layout tabbed +workspace_layout tabbed # automatically jump back to previous workspace workspace_auto_back_and_forth yes +# messaging +workspace 2 output LVDS-1 + +# web and doc +workspace 1 output VGA-1 + +# editor and IDE +workspace 3 output DP-2 + # change focus bindsym $mod+h focus left bindsym $mod+j focus down @@ -273,11 +285,22 @@ seat * { hide_cursor 5000 } -#default_floating_border none -for_window [class="jetbrains-studio"] floating enable -focus_follows_mouse no +assign [app_id="thunderbird"] workspace 1 +assign [app_id="telegramdesktop"] workspace 1 +assign [app_id="firefox" title="Riot.*"] workspace 1 +assign [app_id="firefox" title="Instant messaging.*"] workspace 1 +assign [app_id="firefox" title="Threema Web.*"] workspace 1 +assign [app_id="firefox" title="chaos\.social.*"] workspace 1 +assign [app_id="thunderbird" title="Write:.*"] workspace 3 +assign [app_id="firefox"] workspace 2 +assign [app_id="jetbrains-studio"] workspace 3 +assign [app_id="org.keepassxc.KeePassXC"] workspace 10 exec xset s off #exec xss-lock -- lock-session exec swayidle -w timeout 300 '$HOME/bin/lock-session' timeout 240 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep '$HOME/bin/lock-session' lock '$HOME/bin/lock-session' #exec redshift +exec keepassxc +exec firefox +exec thunderbird +exec telegram diff --git a/sway/default.nix b/sway/default.nix new file mode 100644 index 0000000..e8492e6 --- /dev/null +++ b/sway/default.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ...}: +{ + home.packages = with pkgs; [ + qt5.qtwayland + swaylock + swayidle + xwayland + mako + kanshi + i3blocks + termite + bemenu + xss-lock + ]; + + wayland.windowManager.sway = { + enable = true; + config = null; + extraConfig = (builtins.readFile ./config); + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + }; +} diff --git a/vim/default.nix b/vim/default.nix index d3d3ef8..5e5004c 100644 --- a/vim/default.nix +++ b/vim/default.nix @@ -5,6 +5,16 @@ let version = "2010-11-06"; src = vim/plugins/myFtplugins; }; + spacemacsTheme = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "spacemacs-theme"; + version = "2.0.1"; + src = pkgs.fetchFromGitHub { + owner = "colepeters"; + repo = "spacemacs-theme.vim"; + rev = "056bba9bd05a2c97c63c28216a1c232cfb91529e"; + sha256 = "0iy3i6waigk759p2z59mrxkjc0p412y7d8zf3cjak4a9sh1sh6qz"; + }; + }; in { programs.vim = { @@ -21,6 +31,7 @@ in pkgs.vimPlugins.vim-airline pkgs.vimPlugins.vim-airline-themes pkgs.vimPlugins.vim-fish + spacemacsTheme #pkgs.vimPlugins.vim-gnupg #pkgs.vimPlugins.vim-l9 pkgs.vimPlugins.vim-ledger diff --git a/vim/vimrc b/vim/vimrc index a70af26..7848078 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -53,9 +53,9 @@ if (has("termguicolors")) endif set t_Co=256 -set background=dark -colorscheme base16-spacemacs +set background=dark +colorscheme spacemacs-theme " Use tabs for indent set smarttab