~cnx/dotfiles unlisted

88051c9ccfa9b863b41f0ae86dbb1caaeb739743 — Nguyễn Gia Phong 3 months ago c6b2aca
Overhaul configurations
23 files changed, 110 insertions(+), 120 deletions(-)

M README.md
M awesome/.config/awesome/rc.lua
R commit.sh => bin/.local/bin/gaerc
A bin/.local/bin/totp
D fedora-screenshot.png
D fedora/.bash_profile
D fedora/.bashrc
M newsboat/.config/newsboat/urls
M nix/etc/nixos/awesome.nix
M nix/etc/nixos/configuration.nix
M nix/etc/nixos/devel.nix
D nixos-screenshot.png
D nixos/.config/systemd/user/default.target.wants/mbsync-legacy.timer
D nixos/.config/systemd/user/default.target.wants/mbsync-primary.timer
A nixos/.config/systemd/user/default.target.wants/mbsync.timer
D nixos/.config/systemd/user/mbsync-primary.service
D nixos/.config/systemd/user/mbsync-primary.timer
R nixos/.config/systemd/user/{mbsync-legacy.service => mbsync.service}
R nixos/.config/systemd/user/{mbsync-legacy.timer => mbsync.timer}
M nixos/.xinitrc
M ranger/.config/ranger/rc.conf
M ranger/.config/ranger/rifle.conf
R debian-screenshot.png => screenshot.png
M README.md => README.md +3 -14
@@ 1,20 1,9 @@
# dotfiles

Dotfiles of my Debian testing, Fedora workstation and NixOS unstable,
managed by GNU Stow.
Dotfiles of my Debian and NixOS systems, managed by GNU Stow.

![Debian testing](debian-screenshot.png)
![Screenshot](screenshot.png)

The Debian desktop uses awesome, bash, Git, Firefox, ranger, Vim, URxvt
Both uses awesome, bash, Git, Firefox, ranger, Vim, URxvt
and Zathura. Most of these applications are themed with the
[srcery](https://github.com/srcery-colors/srcery-vim) colorscheme.

![Fedora workstation](fedora-screenshot.png)

The Fedora desktop is vanilla GNOME with Emacs. Yes you can run four systems
in parallel: GNU/Linux, systemd, GNOME JS VM and Emacs.

![NixOS unstable](nixos-screenshot.png)

The NixOS uses KDE Plasma with Emacs and Alacritty.  Nothing really special
other than the Nix itself.

M awesome/.config/awesome/rc.lua => awesome/.config/awesome/rc.lua +36 -16
@@ 1,17 1,18 @@
-- Standard awesome library
local gears = require"gears"
-- Awesome library
local awful = require"awful"
require"awful.autofocus"
-- Widget and layout library
local beautiful = require"beautiful"
local gears = require"gears"
local menubar = require"menubar"
local naughty = require"naughty"
local wibox = require"wibox"

-- Awful submodules
require"awful.autofocus"
local show_help = require"awful.hotkeys_popup".widget.show_help

-- Menu library
local freedesktop = require"freedesktop"
-- Theme handling library
local beautiful = require"beautiful"
-- Notification library
local naughty = require"naughty"
local menubar = require"menubar"
local hotkeys_popup = require"awful.hotkeys_popup".widget

-- System data library
local vicious = require"vicious"



@@ 64,8 65,9 @@ local play_pause = "playerctl play-pause"
local rewind = "playerctl previous"
local forward = "playerctl next"

local scrot = "scrot /home/cnx/Desktop/%FT%T.png"
local scrot_select = "scrot --border --select /home/cnx/Desktop/%FT%T.png"
local home = os.getenv("HOME")
local scrot = "scrot " .. home .. "/Desktop/%FT%T.png"
local scrot_select = "scrot --border --select " .. home .. "/Desktop/%FT%T.png"

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.


@@ 122,7 124,7 @@ end
-- {{{ Menu
-- Create a launcher widget and a main menu
local myawesomemenu = {
  {"hotkeys", function () return false, hotkeys_popup.show_help end},
  {"hotkeys", function () return false, show_help end},
  {"manual", terminal .. " -e man awesome"},
  {"edit config", editor .. " " .. awesome.conffile},
  {"restart", awesome.restart},


@@ 134,6 136,24 @@ local mymainmenu = freedesktop.menu.build{
  after = {{"Open terminal", terminal}}
}

local function showclipboard()
  local base = home .. "/.cache/threa/"
  local command = "threac %s && xdotool key shift+Insert"
  local f = io.open(base .. "order")
  local order = f:read("*a")
  f:close()

  local items = {}
  for c in order:gmatch(".") do
    local f = io.open(base .. c)
    table.insert(items, {f:read("*a"):gsub("\n", " "), function ()
      awful.spawn.with_shell(command:format(c))
    end})
    f:close()
  end
  awful.menu{items = items, theme = {width = 911}}:show()
end

-- mylauncher = awful.widget.launcher{image = beautiful.awesome_icon,
--                                    menu = mymainmenu}



@@ 420,7 440,7 @@ end
local globalkeys = awful.util.table.join(
  awful.key({modkey, "Control"}, "x", lua_prompt,
            {description = "execute prompt", group = "awesome"}),
  awful.key({modkey, "Control"}, "s", hotkeys_popup.show_help,
  awful.key({modkey, "Control"}, "s", show_help,
            {description="show help", group="awesome"}),
  awful.key({modkey}, "Left", awful.tag.viewprev,
            {description = "view previous", group = "tag"}),


@@ 435,6 455,8 @@ local globalkeys = awful.util.table.join(
            {description = "focus previous by index", group = "client"}),
  awful.key({modkey}, "w", function () mymainmenu:show() end,
            {description = "show main menu", group = "awesome"}),
  awful.key({modkey}, "d", showclipboard,
            {description = "show clipboard", group = "awesome"}),

  -- Layout manipulation
  awful.key({modkey, "Shift"}, "j", function () awful.client.swap.byidx(1) end,


@@ 494,8 516,6 @@ local globalkeys = awful.util.table.join(
            {description = "open Clojure interpreter", group = "launcher"}),
  awful.key({modkey}, "g", spawner(guile),
            {description = "open Guile interpreter", group = "launcher"}),
  awful.key({modkey}, "d", spawner"diodon",
            {description = "open clipboard manager", group = "launcher"}),
  awful.key({modkey}, "s", spawner"slock",
            {description = "lock screen", group = "launcher"}),
  awful.key({modkey, "Shift"}, "s", spawner(slock_suspend),

R commit.sh => bin/.local/bin/gaerc +1 -1
@@ 1,2 1,2 @@
#!/bin/sh
git commit -am "Update $(date -I)"
exec urxvt -e aerc "$@"

A bin/.local/bin/totp => bin/.local/bin/totp +2 -0
@@ 0,0 1,2 @@
#!/bin/sh
oathtool --totp --base32 $(cat $HOME/.totp/$1)

D fedora-screenshot.png => fedora-screenshot.png +0 -0
D fedora/.bash_profile => fedora/.bash_profile +0 -10
@@ 1,10 0,0 @@
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs
export GOPATH=$HOME/.local/share/go
export PATH=$PATH:$HOME/.local/bin:$GOPATH/bin:$HOME/.cargo/bin

D fedora/.bashrc => fedora/.bashrc +0 -23
@@ 1,23 0,0 @@
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
alias stow='stow -t /home/436e58'
alias gcc='gcc -Wall -Werror -O2 -lm'
alias g++='g++ -Wall -Werror -O2 -lm'
alias fpc='fpc -O1 -XS -gl'
alias raku='rlwrap perl6'
alias backup='rsync -avh --delete /home/ /data/Home/'

PATH="/home/436e58/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/436e58/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/436e58/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/436e58/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/436e58/perl5"; export PERL_MM_OPT;

M newsboat/.config/newsboat/urls => newsboat/.config/newsboat/urls +1 -0
@@ 5,6 5,7 @@ https://www.fsf.org/static/fsforg/rss/news.xml
https://www.fsf.org/static/fsforg/rss/jobs.xml
https://ar.al/index.xml
https://andrewkelley.me/rss.xml
https://tyil.nl/atom.xml
https://andrewshitov.com/feed
https://codesections.com/rss.xml
https://pgjones.dev/blog/atom.xml

M nix/etc/nixos/awesome.nix => nix/etc/nixos/awesome.nix +4 -3
@@ 28,10 28,11 @@

  environment.systemPackages = with pkgs; [
    gnome.adwaita-icon-theme qt5ct
    gnome.networkmanagerapplet mate.mate-power-manager playerctl pulsemixer
    gnome.networkmanagerapplet keynav mate.mate-power-manager
    clipnotify playerctl pulsemixer xclip xdotool
    rxvt_unicode-with-plugins urxvt_autocomplete_all_the_things urxvt_font_size
    aerc amfora autocutsel firefox keynav newsboat ranger
    arandr audacious gimp scrot vim_configurable
    aerc amfora newsboat ranger ueberzug vim_configurable
    arandr audacious firefox gimp nheko scrot xorg.xkill zathura
  ];

  programs.nm-applet.enable = true;

M nix/etc/nixos/configuration.nix => nix/etc/nixos/configuration.nix +28 -15
@@ 13,13 13,19 @@

  # Use the systemd-boot EFI boot loader.
  boot.loader = {
    systemd-boot.enable = true;
    efi.canTouchEfiVariables = true;
    grub.useOSProber = true;
    grub = {
      enable = true;
      device = "nodev";
      efiSupport = true;
      useOSProber = true;
      splashImage = null;
    };
  };

  networking = {
    hostName = "nix";
    nameservers = [ "9.9.9.11" "149.112.112.11" ];
    networkmanager.enable = true;

    # The global useDHCP flag is deprecated, therefore explicitly set


@@ 56,23 62,30 @@

  environment.systemPackages = with pkgs; [
    htop isync killall oathToolkit rsync stow w3m wget
    ffmpeg mpv pavucontrol pqiv
    ffmpeg mpv pavucontrol vimiv-qt youtube-dl
  ];

  security.rtkit.enable = true;
  # List services that you want to enable:
  services.printing.enable = true;
  services = {
    pipewire = {
      enable = true;
      alsa.enable = true;
      alsa.support32Bit = true;
      pulse.enable = true;
      jack.enable = true;

  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;

    # Use the example session manager (no others are packaged yet so this is
    # enabled by default, no need to redefine it in your config for now)
    # media-session.enable = true;
      # Use the example session manager (no others are packaged yet so this is
      # enabled by default, no need to redefine it in your config for now)
      # media-session.enable = true;
    };

    printing.enable = true;

    dictd = {
      enable = true;
      DBs = with pkgs.dictdDBs; [ wiktionary wordnet ];
    };
  };

  # This value determines the NixOS release from which the default

M nix/etc/nixos/devel.nix => nix/etc/nixos/devel.nix +11 -2
@@ 2,8 2,8 @@

{
  environment.systemPackages = with pkgs; [
    exa fd git ripgrep
    clojure guile leiningen python3 rakudo zig
    exa fd git glow ripgrep rlwrap
    clojure guile julia-stable leiningen lua python3 rakudo zig
    texlive.combined.scheme-tetex
  ];



@@ 19,5 19,14 @@
      enable = true;
      dataDir = "/data/IPFS";
    };

    postgresql = {
      enable = true;
      enableTCPIP = true;
      authentication = pkgs.lib.mkOverride 10 ''
        local all all trust
        host all all ::1/128 trust
      '';
    };
  };
}

D nixos-screenshot.png => nixos-screenshot.png +0 -0
D nixos/.config/systemd/user/default.target.wants/mbsync-legacy.timer => nixos/.config/systemd/user/default.target.wants/mbsync-legacy.timer +0 -1
@@ 1,1 0,0 @@
/home/sea/.config/systemd/user/mbsync-legacy.timer
\ No newline at end of file

D nixos/.config/systemd/user/default.target.wants/mbsync-primary.timer => nixos/.config/systemd/user/default.target.wants/mbsync-primary.timer +0 -1
@@ 1,1 0,0 @@
/home/sea/.config/systemd/user/mbsync-primary.timer
\ No newline at end of file

A nixos/.config/systemd/user/default.target.wants/mbsync.timer => nixos/.config/systemd/user/default.target.wants/mbsync.timer +1 -0
@@ 0,0 1,1 @@
/home/sea/.config/systemd/user/mbsync.timer
\ No newline at end of file

D nixos/.config/systemd/user/mbsync-primary.service => nixos/.config/systemd/user/mbsync-primary.service +0 -12
@@ 1,12 0,0 @@
[Unit]
Description=Synchronize IMAP and MailDir for primary account
Documentation=man:mbsync(1)
ConditionPathExists=%h/.mbsyncrc
After=network.target

[Service]
ExecStart=/usr/bin/mbsync primary
Type=oneshot

[Install]
WantedBy=default.target

D nixos/.config/systemd/user/mbsync-primary.timer => nixos/.config/systemd/user/mbsync-primary.timer +0 -11
@@ 1,11 0,0 @@
[Unit]
Description=Timer for primary accound mbsync
ConditionPathExists=%h/.mbsyncrc
After=network.target

[Timer]
OnBootSec=1m
OnUnitInactiveSec=1m

[Install]
WantedBy=default.target

R nixos/.config/systemd/user/mbsync-legacy.service => nixos/.config/systemd/user/mbsync.service +2 -2
@@ 1,11 1,11 @@
[Unit]
Description=Synchronize IMAP and MailDir for legacy account
Description=Synchronize IMAP and MailDir
Documentation=man:mbsync(1)
ConditionPathExists=%h/.mbsyncrc
After=network.target

[Service]
ExecStart=/usr/bin/mbsync legacy
ExecStart=/run/current-system/sw/bin/mbsync primary legacy
Type=oneshot

[Install]

R nixos/.config/systemd/user/mbsync-legacy.timer => nixos/.config/systemd/user/mbsync.timer +1 -1
@@ 1,5 1,5 @@
[Unit]
Description=Timer for legacy accound mbsync
Description=Timer for mbsync
ConditionPathExists=%h/.mbsyncrc
After=network.target


M nixos/.xinitrc => nixos/.xinitrc +1 -3
@@ 4,8 4,6 @@ ibus-daemon -drx
nm-applet &
keynav &
audacious &
autocutsel -fork
autocutsel -selection PRIMARY -fork
#diodon &
thread &
autorandr --change
exec awesome

M ranger/.config/ranger/rc.conf => ranger/.config/ranger/rc.conf +18 -5
@@ 57,7 57,7 @@ set automatically_count_files true
set open_all_images true

# Be aware of version control systems and display information.
set vcs_aware false
set vcs_aware true

# State of the four backends git, hg, bzr, svn. The possible states are
# disabled, local (only show local info), enabled (show local and remote


@@ 67,6 67,9 @@ set vcs_backend_hg disabled
set vcs_backend_bzr disabled
set vcs_backend_svn disabled

# Truncate the long commit messages to this length when shown in the statusbar.
set vcs_msg_length 50

# Use one of the supported image preview protocols
set preview_images true



@@ 106,7 109,12 @@ set preview_images true
#   while slower, this allows remote previews,
#   for example during an ssh session.
#   Tmux is unsupported.
set preview_images_method urxvt
#
# * ueberzug:
#   Preview images in full color with the external command "ueberzug".
#   Images are shown by using a child window.
#   Only for users who run X11 in GNU/Linux.
set preview_images_method ueberzug

# Delay in seconds before displaying an image with the w3m method.
# Increase it in case of experiencing display corruption.


@@ 182,7 190,7 @@ set shorten_title 3
set hostname_in_titlebar true

# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
set tilde_in_titlebar false
set tilde_in_titlebar true

# How many directory-changes or console-commands should be kept in history?
set max_history_size 20


@@ 242,7 250,7 @@ set cd_tab_fuzzy true

# Avoid previewing files larger than this size, in bytes.  Use a value of 0 to
# disable this feature.
set preview_max_size 0
set preview_max_size 4194304

# The key hint lists up to this size have their sublists expanded.
# Otherwise the submaps are replaced with "...".


@@ 273,7 281,7 @@ set line_numbers relative
set relative_current_zero false

# Start line numbers from 1 instead of 0
set one_indexed false
set one_indexed true

# Save tabs on exit
set save_tabs_on_exit false


@@ 290,6 298,11 @@ set global_inode_type_filter
# should be 'false' during start-up, but you can toggle it by pressing F.
set freeze_files false

# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
# give a warning when you nest ranger in a subshell started by ranger.
# Special value "error" makes the warning more visible.
set nested_ranger_warning false

# ===================================================================
# == Local Options
# ===================================================================

M ranger/.config/ranger/rifle.conf => ranger/.config/ranger/rifle.conf +1 -0
@@ 170,6 170,7 @@ ext cbr, has mcomix, X, flag f = mcomix -- "$@"
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display,  X, flag f = display -- "$@"

mime ^image, has vimiv,     X, flag f = vimiv "$@"
mime ^image, has viewnior,  X, flag f = viewnior "$@"
mime ^image, has pqiv,      X, flag f = pqiv -- "$@"
mime ^image, has sxiv,      X, flag f = sxiv -- "$@"

R debian-screenshot.png => screenshot.png +0 -0