aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-10-15 00:51:15 +0530
committerAkshay Nair <phenax5@gmail.com>2023-10-15 00:51:15 +0530
commit32d0bd79637cdc6400798bc033c8e2149ec4c5a6 (patch)
treedf6f25cb31bb2b93a1af5104b613c96013b823b9
parent4eb5f01f1f7a11527be56bd8a8afecd31d640b15 (diff)
downloadnixos-config-32d0bd79637cdc6400798bc033c8e2149ec4c5a6.tar.gz
nixos-config-32d0bd79637cdc6400798bc033c8e2149ec4c5a6.zip
config sync
-rw-r--r--config/lf/lfrc67
-rw-r--r--config/qutebrowser/.gitignore1
-rw-r--r--config/qutebrowser/config.py18
-rw-r--r--config/qutebrowser/quickmarks4
-rw-r--r--config/qutebrowser/security.py3
-rw-r--r--config/qutebrowser/ui.py2
-rw-r--r--config/zsh/aliases.zsh3
-rw-r--r--config/zsh/aliases/dev.zsh83
-rw-r--r--config/zsh/aliases/system.zsh16
-rw-r--r--config/zsh/plugins/fzf-cd.zsh16
-rw-r--r--configuration.nix55
-rw-r--r--hardware-configuration.nix1
-rw-r--r--home.nix8
-rw-r--r--modules/git.home.nix1
-rw-r--r--modules/login.nix4
-rw-r--r--overlays-system.nix1
-rw-r--r--overlays/default.nix1
-rw-r--r--overlays/j4-dmenu-desktop.nix9
-rw-r--r--packages.nix28
-rwxr-xr-xpackages/dwm/autostart.sh32
-rw-r--r--packages/dwm/pkg.nix5
-rwxr-xr-xpackages/xmonad/autostart.sh6
-rwxr-xr-xscripts/menuitems.sh23
23 files changed, 217 insertions, 170 deletions
diff --git a/config/lf/lfrc b/config/lf/lfrc
index 671afbc..3df493b 100644
--- a/config/lf/lfrc
+++ b/config/lf/lfrc
@@ -34,13 +34,6 @@ cmd mkfile ${{
$EDITOR $ans
}}
-cmd move_to_trash ${{
- mkdir -p /tmp/.trash-cache/
- echo "$fx" | while read file; do
- mv "$file" /tmp/.trash-cache/
- done;
-}}
-
cmd show_images ${{
if [ "$(echo "$fx" | wc -l)" = "1" ]; then
sxiv $(dirname "$fx") &
@@ -61,22 +54,52 @@ cmd unzip_rar ${{
NIXPKGS_ALLOW_UNFREE=1 nix-shell -p unrar --run 'unrar x $f';
}}
-# }}}
+cmd unpack ${{
+ typ=$(file --mime-type "$f" -bL);
+ case $(typ) in
+ application/zip)
+ unzip "$f"
+ ;;
+ application/x-tar|application/gzip)
+ tar xzf "$f"
+ ;;
+ application/x-7z-compressed)
+ nix-shell -p p7zip --run "7z x '$f'"
+ ;;
+ application/vnd.rar)
+ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p unrar --run "unrar x '$f'"
+ ;;
+ *)
+ lf -remote "send $id echoerr 'Unknown archive type: $typ'";
+ ;;
+ esac
+}}
+
-# Unset old keys {{{
- map w
- map m
- map n
- map "'"
- map '"'
- map d}}
- map c
- map e
- map d
-# }}}
+# Unset old keys
+map w
+map m
+map n
+map p
+map "'"
+map '"'
+map d}}
+map c
+map e
+map d
+
+# TODO: fzf search through files
+
+# fzf search through directories
+cmd fuzzy_search_dirs ${{
+ dir=$(find . -type d | fzf);
+ if ! [ -z "$dir" ]; then
+ lf -remote "send $id cd $dir";
+ fi
+}}
# Mutations
-map dd move_to_trash
+map dd delete
map p paste
map x cut
map y copy
@@ -91,8 +114,12 @@ map . :set hidden!
map st :set sortby time; set info time
map ss :set sortby size; set info size
+# Search next/prev
+map <tab> search-next
+map <backtab> search-prev
# Traversal keys
+map \\f fuzzy_search_dirs
map gdl cd ~/Downloads/dl
map gdm cd ~/Downloads/music
map gdv cd ~/dev
diff --git a/config/qutebrowser/.gitignore b/config/qutebrowser/.gitignore
index 3add446..a3555f0 100644
--- a/config/qutebrowser/.gitignore
+++ b/config/qutebrowser/.gitignore
@@ -1,2 +1,3 @@
qsettings/
autoconfig.yml
+quickmarks
diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py
index bb424a7..8fe4e10 100644
--- a/config/qutebrowser/config.py
+++ b/config/qutebrowser/config.py
@@ -159,8 +159,10 @@ nmap(localleader + 'td', ':toggle-darkmode')
# c.aliases['load'] = 'session-load -t';
# Sessions
-nmap(leader + 'sl', ':set-cmd-text :session-load ');
-nmap(leader + 'sw', ':set-cmd-text :session-save ');
+# nmap(leader + 'sl', ':set-cmd-text :session-load ');
+# nmap(leader + 'sw', ':set-cmd-text :session-save ');
+nmap(leader + 'sl', ':cmd-set-text :session-load ');
+nmap(leader + 'sw', ':cmd-set-text :session-save --no-history');
# }}}
#### Navigation {{{
@@ -192,8 +194,10 @@ c.tabs.new_position.unrelated = 'next'
c.tabs.last_close = 'close' # 'close' for closing window on last d
# Keybindings
-nmap('o', 'set-cmd-text -s :open --tab')
-nmap('O', 'set-cmd-text -s :open')
+# nmap('o', 'set-cmd-text -s :open --tab')
+# nmap('O', 'set-cmd-text -s :open')
+nmap('o', 'cmd-set-text -s :open --tab')
+nmap('O', 'cmd-set-text -s :open')
# Tab
nmap('d', 'tab-close')
@@ -211,6 +215,7 @@ nmap('<Ctrl-j>', 'tab-next')
nmap('<Ctrl-Shift-k>', 'tab-move -')
nmap('<Ctrl-Shift-j>', 'tab-move +')
nmap('b', 'set-cmd-text --space :buffer') # List buffers by index
+# nmap('b', 'cmd-set-text --space :buffer') # List buffers by index
for i in range(1, 10 + 1):
key = 0 if i == 10 else i
@@ -262,6 +267,7 @@ config.set('content.notifications.enabled', True, '*://chat.google.com')
# Google meet
config.set('content.notifications.enabled', False, '*://meet.google.com')
+config.set('content.notifications.enabled', False, '*://*.basecamp.com')
config.set('content.media.audio_video_capture', True, '*://meet.google.com')
config.set('content.media.audio_capture', True, '*://meet.google.com')
config.set('content.media.video_capture', True, '*://meet.google.com')
@@ -331,8 +337,8 @@ nmap(leader + 'tj', 'format-json')
# }}}
#### History {{{
-nmap('<Shift-h>', 'back')
-nmap('<Shift-l>', 'forward')
+nmap('<Shift-h>', 'back --quiet')
+nmap('<Shift-l>', 'forward --quiet')
nmap(leader + 'hh', 'history --tab')
# }}}
diff --git a/config/qutebrowser/quickmarks b/config/qutebrowser/quickmarks
deleted file mode 100644
index a5c1b35..0000000
--- a/config/qutebrowser/quickmarks
+++ /dev/null
@@ -1,4 +0,0 @@
-Whatsapp https://web.whatsapp.com/
-Gmail:personal https://mail.google.com/mail/u/0
-Gmail:colabra https://mail.google.com/mail/u/1
-Twitch:dashboard https://dashboard.twitch.tv/u/ediblemonad/stream-manager
diff --git a/config/qutebrowser/security.py b/config/qutebrowser/security.py
index 287442b..930368a 100644
--- a/config/qutebrowser/security.py
+++ b/config/qutebrowser/security.py
@@ -44,7 +44,8 @@ c.content.media.video_capture = 'ask'
c.content.tls.certificate_errors = 'ask'
c.content.desktop_capture = 'ask'
c.content.mouse_lock = 'ask'
-c.content.javascript.can_access_clipboard = True
+# c.content.javascript.can_access_clipboard = True
+c.content.javascript.clipboard = 'access'
c.content.canvas_reading = True
# c.content.fullscreen.window = True # Fullscreen fixed to window size
diff --git a/config/qutebrowser/ui.py b/config/qutebrowser/ui.py
index aa16249..f1479f3 100644
--- a/config/qutebrowser/ui.py
+++ b/config/qutebrowser/ui.py
@@ -19,7 +19,7 @@ c.fonts.default_family = 'JetBrainsMono Nerd Font'
c.fonts.default_size = '12px'
c.colors.webpage.preferred_color_scheme = 'dark'
-c.colors.webpage.darkmode.enabled = True
+c.colors.webpage.darkmode.enabled = False
c.colors.webpage.darkmode.algorithm = "lightness-cielab"
c.colors.webpage.darkmode.threshold.text = 150
c.colors.webpage.darkmode.threshold.background = 100
diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh
index d9a5ef6..32586e0 100644
--- a/config/zsh/aliases.zsh
+++ b/config/zsh/aliases.zsh
@@ -9,6 +9,9 @@ alias e="sensible-editor";
alias v="nvim";
alias o='open $(fzf)';
+alias j='just';
+alias jl='just -l';
+
# Load work aliases
# source "$HOME/.work-config/zshconf/aliases.zsh";
diff --git a/config/zsh/aliases/dev.zsh b/config/zsh/aliases/dev.zsh
index 4283a2d..cd2de8c 100644
--- a/config/zsh/aliases/dev.zsh
+++ b/config/zsh/aliases/dev.zsh
@@ -6,6 +6,13 @@ alias aws="docker run --rm -it amazon/aws-cli"
# nix shell with zsh
nix-zsh() { nix-shell --run "WITH_NIX_PREFIX='${NX_PREFIX:-':'}' zsh" "$@"; }
+# Gitignore locally per-project
+# Eg - gitignore-locally flake.nix flake.lock
+gitignore-locally() {
+ git add --intent-to-add "$@";
+ git update-index --assume-unchanged "$@";
+}
+
# :: Filename Pattern Replacetext
far() {
local file_r="$1"; shift;
@@ -15,8 +22,8 @@ far() {
}
# :: FileType Filename
-codi() {
- local syntax="${1:-python}"
+calc() {
+ local syntax="${1:-javascript}"
shift
nvim -c \
"let g:startify_disable_at_vimenter = 1 |\
@@ -27,18 +34,23 @@ codi() {
Codi $syntax" "$@"
}
+get_node_script_runner() {
+ if [[ -f ./yarn.json ]]; then echo "yarn";
+ elif [[ -f ./pnpm-lock.yaml ]]; then echo "pnpm";
+ else echo "npm run"; fi;
+}
# Npm run key binding
+# local commands=$(node -e 'const pkg = require("./package.json"); Object.entries(pkg.scripts || {}).map(([key, value]) => console.log(`${key}\t\t\t"${value}"`))');
+# local result=$(echo -e "$commands" | fzf | cut -f1);
p__run_npm_script() {
[[ ! -f "package.json" ]] && return 1;
- local commands=$(node -e 'const pkg = require("./package.json"); Object.entries(pkg.scripts || {}).map(([key, value]) => console.log(`${key}\t\t "${value}"`))');
- # cat package.json | jq -r '.scripts | to_entries | map([.key, .value] | join("\t\t\t")) | .[]' | fzf | cut -f1
-
- local result=$(echo -e "$commands" | fzf | cut -f1);
-
+ local result=$(cat package.json | jq -r '.scripts | to_entries | map([.key, .value] | join("\t\t\t")) | .[]' | fzf | cut -f1);
[[ -z "$result" ]] && return 1;
- yarn "$result";
+
+ print -Rz - "$(get_node_script_runner) $result ";
+ zle send-break
}
zle -N p__run_npm_script;
@@ -47,46 +59,25 @@ bindkey '^B' p__run_npm_script;
# Load shell
-p__load_nix_shell_file() {
- if [[ -f "./default.nix" ]]; then
- echo "";
- echo "ERR: default.nix already exists in directory";
- zle send-break;
- return 1;
- fi;
+# p__load_nix_shell_file() {
+# if [[ -f "./default.nix" ]]; then
+# echo "";
+# echo "ERR: default.nix already exists in directory";
+# zle send-break;
+# return 1;
+# fi;
+#
+# local shells=$(ls ~/nixos/shell);
+# local selected=$(echo -e "$shells" | fzf);
+# [[ -z "$selected" ]] && return 1;
+# cp ~/nixos/shell/$selected ./default.nix;
+# zle send-break
+# }
+#
+# zle -N p__load_nix_shell_file;
+# bindkey '^N' p__load_nix_shell_file;
- local shells=$(ls ~/nixos/shell);
- local selected=$(echo -e "$shells" | fzf);
- [[ -z "$selected" ]] && return 1;
- cp ~/nixos/shell/$selected ./default.nix;
- zle send-break
-}
-
-zle -N p__load_nix_shell_file;
-bindkey '^N' p__load_nix_shell_file;
-
-
-
-# Enter shell
-p__enter_nixshell() {
- if [[ -f "./default.nix" ]] || [[ -f "./shell.nix" ]]; then
- shell="nix-zsh"
- if [[ -f "./shell.nix" ]]; then
- shell="nix-zsh ./shell.nix"
- fi
- $shell
- zle send-break
- return 0;
- else
- echo "";
- echo "ERR: No default.nix or shell.nix in directory";
- zle send-break;
- return 1;
- fi;
-}
-zle -N p__enter_nixshell;
-bindkey '^X' p__enter_nixshell;
fix-interpreter() {
nix-shell -p patchelf --run "patchelf --set-interpreter \$(patchelf --print-interpreter \$(which mkdir)) $@"
diff --git a/config/zsh/aliases/system.zsh b/config/zsh/aliases/system.zsh
index 4554289..031bb1b 100644
--- a/config/zsh/aliases/system.zsh
+++ b/config/zsh/aliases/system.zsh
@@ -21,3 +21,19 @@ nix-rollback() {
#sv_enable() { [[ -f "/etc/runit/sv/$1" ]] && sudo ln -s /etc/runit/sv/$1 /run/runit/service; }
#sv_disable() { sudo unlink /run/runit/service/$1; }
+setup_webcam_day() {
+ v4l2-ctl -d /dev/video2 --set-ctrl exposure_absolute=300
+ v4l2-ctl -d /dev/video2 --set-ctrl gamma=180
+ v4l2-ctl -d /dev/video2 --set-ctrl saturation=17
+ v4l2-ctl -d /dev/video2 --set-ctrl contrast=12
+ v4l2-ctl -d /dev/video2 --set-ctrl brightness=1
+}
+
+setup_webcam_night() {
+ v4l2-ctl -d /dev/video2 --set-ctrl exposure_absolute=400
+ v4l2-ctl -d /dev/video2 --set-ctrl gamma=230
+ v4l2-ctl -d /dev/video2 --set-ctrl saturation=16
+ v4l2-ctl -d /dev/video2 --set-ctrl contrast=11
+ v4l2-ctl -d /dev/video2 --set-ctrl brightness=1
+}
+
diff --git a/config/zsh/plugins/fzf-cd.zsh b/config/zsh/plugins/fzf-cd.zsh
index e4b4337..f1897c5 100644
--- a/config/zsh/plugins/fzf-cd.zsh
+++ b/config/zsh/plugins/fzf-cd.zsh
@@ -1,12 +1,22 @@
+
+fzf-change-dir-cwd() { # fzf + cd in cwd
+ selected=$(find . -maxdepth 1 -type d | fzf);
+ if [ ! -z "$selected" ] && [ "$selected" != "$(pwd)" ]; then
+ cd $selected;
+ fi
+ zle send-break
+}
+
+zle -N fzf-change-dir-cwd;
+bindkey '^O' fzf-change-dir-cwd;
+
fzf-change-dir() {
local result=$(find -type d | fzf);
-
if ! [[ -z "$result" ]]; then
cd "$result"
fi
-
zle send-break
}
zle -N fzf-change-dir;
-bindkey '^P' fzf-change-dir;
+bindkey '^F' fzf-change-dir;
diff --git a/configuration.nix b/configuration.nix
index e8033df..f22cd58 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -24,38 +24,24 @@ in
allowBroken = false;
};
- services.tlp = {
- enable = true;
- };
+ services.tlp.enable = true;
services.udisks2.enable = true;
programs.dconf.enable = true;
- # services.borgbackup =
- # let
- # homeDir = config.users.users.imsohexy.home;
- # user = config.users.users.imsohexy.name;
- # in
- # {
- # jobs = {
- # testBkup = {
- # paths = "${homeDir}/dump/elm-worker-tmp";
- # repo = "${homeDir}/dump/backups";
- # compression = "none";
- # startAt = "weekly";
- # user = user;
- # group = "users";
- # encryption = {
- # mode = "none";
- # };
- # # encryption = {
- # # mode = "repokey";
- # # passCommand = "pass show BorgBackup/imsohexy";
- # # };
- # };
- # };
- # };
+ # Fix hmr issue?
+ systemd.extraConfig = ''DefaultLimitNOFILE=65536'';
+ systemd.user.extraConfig = ''DefaultLimitNOFILE=65536'';
+ boot.kernel.sysctl."fs.inotify.max_user_instances" = 8192;
+ security.pam.loginLimits = [
+ {
+ domain = "*";
+ type = "-";
+ item = "nofile";
+ value = "65536";
+ }
+ ];
# NOTE: Enable bluetooth using this and then use bluetoothctl
# hardware.bluetooth.enable = true;
@@ -84,28 +70,27 @@ in
# Network
networking = {
- hostName = "dickhead";
+ hostName = "smartfridge";
firewall = {
enable = true;
- allowedTCPPorts = [ 8080 ];
- allowedUDPPorts = [ ];
+ allowedTCPPorts = [ 8080 3000 3001 ];
+ allowedUDPPorts = [ 41641 ];
};
+ nameservers = [ "100.100.100.100" "8.8.8.8" "1.1.1.1" ];
+ search = [ "resolve.construction" ];
networkmanager.enable = true;
extraHosts = ''
127.0.0.1 phenax.local
- 127.0.0.1 hasura.colabra
+ 127.0.0.1 field.shape-e2e.com
'';
};
+ services.tailscale.enable = true;
services.atd.enable = true;
virtualisation = {
docker = {
enable = true;
- # autoPrune = {
- # enable = true;
- # flags = [ "--volumes" ];
- # };
};
lxd.enable = false;
virtualbox.host.enable = false;
diff --git a/hardware-configuration.nix b/hardware-configuration.nix
index 4cc7a61..f4eb75f 100644
--- a/hardware-configuration.nix
+++ b/hardware-configuration.nix
@@ -7,6 +7,7 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
+ # 2-Sep-2023, Bug: https://nixpk.gs/pr-tracker.html?pr=252605
boot.kernelPackages = pkgs.linuxPackages_5_10;
boot.initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" ];
diff --git a/home.nix b/home.nix
index ac21afd..d947304 100644
--- a/home.nix
+++ b/home.nix
@@ -39,6 +39,11 @@ in
# image/jpeg=sxiv.desktop
# '';
+ services.easyeffects = {
+ enable = true;
+ preset = "default";
+ };
+
programs.lsd = {
enable = true;
enableAliases = true;
@@ -83,8 +88,6 @@ in
#'';
};
- # services.network-manager-applet.enable = true;
-
home.file = {
".config/xorg".source = ./config/xorg;
".config/zsh".source = ./config/zsh;
@@ -93,7 +96,6 @@ in
".config/sxiv".source = ./config/sxiv;
".local/share/qutebrowser/userscripts".source = ./config/qutebrowser/userscripts;
".local/share/qutebrowser/greasemonkey".source = ./config/qutebrowser/greasemonkey;
- # ".local/share/qutebrowser/sessions".source = ./private-config/qutebrowser/sessions;
".config/dunst".source = ./config/dunst;
".config/lf".source = ./config/lf;
".config/picom.conf".source = ./config/picom.conf;
diff --git a/modules/git.home.nix b/modules/git.home.nix
index 66cd793..05317d9 100644
--- a/modules/git.home.nix
+++ b/modules/git.home.nix
@@ -10,6 +10,7 @@
"tags.lock"
"tags.temp"
"ayak.sh"
+ ".direnv"
];
aliases = {
ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi";
diff --git a/modules/login.nix b/modules/login.nix
index 1462871..ea7a2d8 100644
--- a/modules/login.nix
+++ b/modules/login.nix
@@ -1,8 +1,8 @@
{ pkgs, ... }:
let
sessions = [
- [ "tty1" windowManagers.xmonad ]
- [ "tty2" windowManagers.bspwm ]
+ [ "tty1" windowManagers.dwm ]
+ [ "tty2" windowManagers.xmonad ]
];
windowManagers = {
dwm = looped "dwm";
diff --git a/overlays-system.nix b/overlays-system.nix
index a14e8d6..5bbe607 100644
--- a/overlays-system.nix
+++ b/overlays-system.nix
@@ -6,5 +6,6 @@ in
nixpkgs.overlays = with overlays; [
# neovim-nightly
qutebrowser
+ j4-dmenu-desktop
];
}
diff --git a/overlays/default.nix b/overlays/default.nix
index d4e2b45..875338d 100644
--- a/overlays/default.nix
+++ b/overlays/default.nix
@@ -2,4 +2,5 @@ _: {
neovim-nightly = import ./neovim.nix;
qutebrowser = import ./qutebrowser.nix;
pass-with-dmenu = import ./pass.nix;
+ j4-dmenu-desktop = import ./j4-dmenu-desktop.nix;
}
diff --git a/overlays/j4-dmenu-desktop.nix b/overlays/j4-dmenu-desktop.nix
new file mode 100644
index 0000000..91d1234
--- /dev/null
+++ b/overlays/j4-dmenu-desktop.nix
@@ -0,0 +1,9 @@
+self: super:
+let
+ localPkgs = import ../packages/default.nix { pkgs = super.pkgs; };
+in
+{
+ j4-dmenu-desktop = super.j4-dmenu-desktop.override {
+ dmenu = localPkgs.dmenu;
+ };
+}
diff --git a/packages.nix b/packages.nix
index b701fa7..e17be41 100644
--- a/packages.nix
+++ b/packages.nix
@@ -5,9 +5,9 @@ let
customPackages = with localPkgs; [
sensible-apps
shotkey
- xmonad
- # dwm
- # dwmblocks
+ # xmonad
+ dwm
+ dwmblocks
st
dmenu
anypinentry
@@ -23,18 +23,16 @@ let
ctags
fzf
docker-compose
- gibo
direnv
gh
+ # gibo
gcc
gnumake
- nodejs-18_x
+ nodejs_20
- # godot
-
- bspwm
- sxhkd
+ # bspwm
+ # sxhkd
rnix-lsp
efm-langserver
@@ -43,8 +41,7 @@ let
nodePackages.typescript-language-server
nodePackages.vscode-json-languageserver
nodePackages.vscode-langservers-extracted
- # nodePackages.tsun
- # nodePackage.bash-language-server
+ nodePackages.prettier
];
apps = with pkgs; [
@@ -55,9 +52,7 @@ let
# ungoogled-chromium
# Comm
- # slack
- # signal-cli
- # signal-desktop
+ slack
# Media
spotify
@@ -71,6 +66,7 @@ let
krita
zathura
blender
+ j4-dmenu-desktop
# chiaki # PS remote play
@@ -81,7 +77,7 @@ let
# qjackctl
# ardour
pavucontrol
- easyeffects
+ # easyeffects
# TUI stuff
lf
@@ -128,6 +124,8 @@ let
xclip
xdo
xdotool
+
+ v4l-utils
];
in
{
diff --git a/packages/dwm/autostart.sh b/packages/dwm/autostart.sh
index 5421000..65a02ee 100755
--- a/packages/dwm/autostart.sh
+++ b/packages/dwm/autostart.sh
@@ -26,9 +26,15 @@ once() {
# Kill previous instance and run again
run() {
local name=$1; shift;
- [[ ! -z "$name" ]] && pkill "$name" && sleep 0.05;
+ [[ ! -z "$name" ]] && pkill "$name" && sleep 0.1;
is_kill || $@ &
}
+
+spew() {
+ local name=$1; shift;
+ [[ ! -z "$name" ]] && pkill "$name" && sleep 0.1;
+ is_kill || setsid -f "$@" &
+}
# }}}
@@ -36,29 +42,29 @@ run() {
echo "[Autostart]: Running daemons";
# Key daemon
- run "shotkey" shotkey;
+ spew "shotkey" shotkey;
# Wallpaper
run "" ~/.fehbg;
- # Dwm blocks status text
- # run "dwmblocks" dwmblocks;
-
# Notification daemon
- run "dunst" dunst -config ~/.config/dunst/dunstrc;
+ spew "dunst" dunst -config ~/.config/dunst/dunstrc;
# Compositor
- run "picom" picom --experimental-backends --config ~/.config/picom.conf;
-
- # Cron jobs
- #run "crond" crond -n -f ~/.config/crontab/crontab;
+ spew "picom" picom --config ~/.config/picom.conf;
# Scheduler
- run "remind" remind -k"notify-send -a reminder %s" -z10 $REMINDER_FILE;
+ spew "remind" remind -k='notify-send -a reminder %s' -z10 "$REMINDER_FILE";
# Battery watcher
run "" ~/scripts/battery-watch.sh start;
+ # Dwm blocks status text
+ # run "dwmblocks" dwmblocks;
+
+ # Cron jobs
+ #run "crond" crond -n -f ~/.config/crontab/crontab;
+
# Disk automount
#once "udiskie" ~/.bin/with_zsh udiskie;
@@ -88,7 +94,9 @@ echo "[Autostart]: Checking applications";
#on_startup sensible-browser;
applications() {
- #sleep 0.5;
+ sleep 0.5;
+
+ run "dwmblocks" dwmblocks;
#focus_tag 9;
#on_startup :today;
diff --git a/packages/dwm/pkg.nix b/packages/dwm/pkg.nix
index 322071e..a5b1b1d 100644
--- a/packages/dwm/pkg.nix
+++ b/packages/dwm/pkg.nix
@@ -3,16 +3,15 @@ with pkgs.lib;
stdenv.mkDerivation rec {
name = "local-dwm-${version}";
- version = "6.2.0";
+ version = "6.2.1";
src = ./source;
buildInputs = [ libX11 libXinerama libXft ];
-
unpackPhase = ''cp -r $src/* .'';
- buildPhase = ''make'';
+ buildPhase = ''make clean dwm'';
installPhase = ''make PREFIX=$out DESTDIR="" install'';
}
diff --git a/packages/xmonad/autostart.sh b/packages/xmonad/autostart.sh
index 36f0cd7..d62d895 100755
--- a/packages/xmonad/autostart.sh
+++ b/packages/xmonad/autostart.sh
@@ -41,18 +41,12 @@ run() {
# Wallpaper
run "" ~/.fehbg;
- # Dwm blocks status text
- # run "dwmblocks" dwmblocks;
-
# Notification daemon
run "dunst" dunst -config ~/.config/dunst/dunstrc;
# Compositor
run "picom" picom --config ~/.config/picom.conf;
- # Cron jobs
- #run "crond" crond -n -f ~/.config/crontab/crontab;
-
# Scheduler
run "remind" remind -k"notify-send -a reminder %s" -z10 $REMINDER_FILE;
diff --git a/scripts/menuitems.sh b/scripts/menuitems.sh
index 4cdb086..c80dff6 100755
--- a/scripts/menuitems.sh
+++ b/scripts/menuitems.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-volume_component() { amixer get Master | awk -F'[][]' '/dB/ {print $C}' C="$1"; }
+volume_component() { amixer get Master | awk -F'[][]' '/Left:/ {print $C}' C="$1"; }
mic_component() { amixer get Capture | awk -F'[][]' '/dB/ {print $C}' C="$1" | head -n 1; }
playerctl_icon() {
@@ -14,25 +14,21 @@ playerctl_icon() {
}
network_state() {
- local state=$(nmcli dev show wlp5s0);
- local ssid=$(echo -e "$state" | grep '^GENERAL.CONNECTION:' | sed 's/^GENERAL.CONNECTION:\s*//g');
-
- [[ "$ssid" == "--" ]] && ssid="";
-
- echo "$([[ -z "$ssid" ]] && echo "offline" || echo "online") ${ssid:0:12}...";
+ local status=$((nmcli dev show wlp1s0 || echo "") | grep '^GENERAL.STATE:' | sed 's/^GENERAL.STATE:\s*//g');
+ echo " ${status:0:16}";
}
-volume_icon() { volume_component 6 | sed 's/on//; s/off/🔇/'; }
-mic_icon() { mic_component 6 | sed 's/on//; s/off/✖/'; }
+volume_icon() { volume_component 4 | sed 's/on//; s/off/🔇/'; }
+mic_icon() { mic_component 4 | sed 's/on//; s/off/✖/'; }
icon() {
case "$1" in
date) echo "" ;;
battery) echo "" ;;
music) playerctl_icon ;;
- volume) echo -n "[$(mic_icon)] $(volume_icon)" ;;
+ volume) volume_icon ;;
brightness) echo "" ;;
- network) network_state | sed 's/online//; s/idle//; s/offline/❌/' ;;
+ network) network_state ;; # | sed 's/\(connected\)//; s/\(connecting.*\)//; s/\(disconnected\)/❌/' ;;
*) ;;
esac
}
@@ -56,7 +52,7 @@ brightness_module() {
}
volume_module() {
- echo "$(icon volume) $(volume_component 2)";
+ echo "$(icon volume) $(volume_component 2)";
}
keymode_module() {
@@ -82,4 +78,5 @@ get_module() {
padding=" ";
-echo "$padding$(get_module $1)$padding";
+echo "$padding$(get_module $1 || echo "-")$padding";
+exit 0;