add tooling.nix

This commit is contained in:
Tyler Starr 2023-05-20 09:16:45 -07:00
parent 3942238dba
commit 449cbfae84
16 changed files with 154 additions and 86 deletions

View File

@ -7,11 +7,11 @@
set $HOME /home/tstarr set $HOME /home/tstarr
set $DISP_PRI HDMI-A-1 set $DISP_PRI DP-2
set $DISP_SEC DP-3 set $DISP_SEC HDMI-A-1
set $BOR_WIDTH 4 set $BOR_WIDTH 3
set $GAP_INNER 4 set $GAP_INNER 3
set $mod Mod4 set $mod Mod4
@ -32,20 +32,26 @@ set $mode_power "[r]eboot | [s]hutdown"
#----- COLORS #----- COLORS
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# class border bground text indicator child_border set $background #282A36
client.focused #bd93f9 #bd93f9 #F8F8F2 #bd93f9 #bd93f9 set $foreground #F8F8F2
client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A set $focused #bd93f9
client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36 set $inactive #44475A
client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555 set $urgent #FF5555
client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36
client.background #F8F8F2 # class border bground text indicator child_border
client.focused $focused $focused $foreground $focused $focused
client.focused_inactive $inactive $inactive $foreground $inactive $inactive
client.unfocused $background $background $foreground $background $background
client.urgent $inactive $urgent $foreground $urgent $urgent
client.placeholder $background $background $foreground $background $background
client.background $foreground
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#----- MISC. CONFIGURATION #----- MISC. CONFIGURATION
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
font pango:Google Noto 8.5 font pango:JetBrains Mono Nerd Font 10
default_border pixel 3 default_border pixel 3
default_floating_border pixel 3 default_floating_border pixel 3
@ -127,7 +133,7 @@ mode utility {
bindsym q exit bindsym q exit
bindsym r reload bindsym r reload
bindsym p exec "rofi-rbw", $e bindsym p exec "rofi-rbw", $e
# TODO: gamemode (mod+Ctrl+g). Needs script to toggle bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e
bindsym Escape mode default bindsym Escape mode default
} }
@ -150,16 +156,18 @@ bindsym $mod+Tab focus mode_toggle
floating_modifier $mod floating_modifier $mod
# spatial container management # spatial container management
bindsym $mod+h focus left bindsym $mod+h exec ~/.config/sway/scripts/tabfocus.sh "h"
bindsym $mod+j focus down bindsym $mod+j exec ~/.config/sway/scripts/tabfocus.sh "j"
bindsym $mod+k focus up bindsym $mod+k exec ~/.config/sway/scripts/tabfocus.sh "k"
bindsym $mod+l focus right bindsym $mod+l exec ~/.config/sway/scripts/tabfocus.sh "l"
bindsym $mod+Shift+h move left bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right bindsym $mod+Shift+l move right
bindsym $mod+minus split v bindsym $mod+minus split v
bindsym $mod+backslash split h bindsym $mod+backslash split h
bindsym $mod+z splith; layout tabbed; focus parent
bindsym $mod+Shift+z layout default
# workspace management # workspace management
bindsym $mod+1 workspace $tag1 bindsym $mod+1 workspace $tag1
@ -180,15 +188,19 @@ bindsym $mod+Shift+e move container to workspace $tag7
bindsym $mod+Shift+r move container to workspace $tag8 bindsym $mod+Shift+r move container to workspace $tag8
# audio # audio
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +2% bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -2% bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
# [o]pen applications # [o]pen applications
bindsym $mod+Return exec alacritty bindsym $mod+Return exec alacritty
bindsym $mod+u exec foot bindsym $mod+a mode rofi
bindsym $mod+a exec rofi -show drun -show-icons mode rofi {
bindsym $mod+Shift+a exec rofi -show window -show-icons bindsym r exec rofi -show drun -show-icons, $e
bindsym w exec rofi -show window -show-icons, $e
bindsym e exec rofi -modi emoji -show emoji, $e
bindsym Escape mode default
}
bindsym $mod+o mode open bindsym $mod+o mode open
mode open { mode open {
bindsym b exec firefox, $e bindsym b exec firefox, $e
@ -206,6 +218,8 @@ mode scratch {
'scratch-nb' 'alacritty -e tmuxinator start nb', $e 'scratch-nb' 'alacritty -e tmuxinator start nb', $e
bindsym t exec $HOME/.config/sway/scripts/scratch.sh \ bindsym t exec $HOME/.config/sway/scripts/scratch.sh \
'scratch-warrior' 'alacritty -e tmuxinator start task', $e 'scratch-warrior' 'alacritty -e tmuxinator start task', $e
bindsym b exec $HOME/.config/sway/scripts/scratch.sh \
'scratch-blue' 'blueman-manager', $e
bindsym Escape mode default bindsym Escape mode default
} }
@ -219,15 +233,25 @@ output DP-3 {
position 2560,0 position 2560,0
} }
bar {
position top
#output $DISP_PRI
status_command while ~/.config/sway/scripts/status.sh; do sleep 1; done
tray_output none
pango_markup enabled
colors {
background #000000
focused_workspace $focused $focused $background
}
}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#----- AUTOSTART WITH I3 #----- AUTOSTART WITH I3
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
exec --no-startup-id "udiskie" exec --no-startup-id "udiskie"
#exec_always --no-startup-id "$HOME/.config/sway/scripts/autolayout.sh"
exec_always --no-startup-id "blueman-applet" exec_always --no-startup-id "blueman-applet"
exec_always --no-startup-id "nm-applet" exec_always --no-startup-id "nm-applet"
exec_always --no-startup-id "flameshot" exec_always --no-startup-id "configure-gtk"
exec_always --no-startup-id "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" exec_always --no-startup-id "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"
exec_always --no-startup-id "waybar" exec --no-startup-id "~/.config/sway/scripts/idle.sh"

View File

@ -1,25 +0,0 @@
#!/usr/bin/env python
import i3ipc
i3 = i3ipc.Connection()
def on_window_event(i3, e):
focused_container = i3.get_tree().find_focused().parent
# Get parent layout of focused window
parent_layout = focused_container.layout
# Get number of windows in focues container
num_parent_windows = len(focused_container.nodes)
# Get number of windows in workspace
workspace = i3.get_tree().find_focused().workspace()
num_workspace_windows = len(workspace.leaves())
if num_parent_windows > 1 and parent_layout != "tabbed":
i3.command("splitv; layout tabbed")
elif num_workspace_windows == 1:
i3.command("layout splith")
# Subscribe to window events
i3.on("window", on_window_event)
# Start the main loop
i3.main()

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
status=$(gamemoded -s)
if [ "$status" == "gamemode is inactive" ]; then
gamemoded -r &
else
killall gamemoded
fi

View File

@ -0,0 +1,3 @@
swayidle -w \
timeout 300 '~/.config/sway/scripts/lock.sh' \
before-sleep '~/.config/sway/scripts/lock.sh'

View File

@ -0,0 +1,21 @@
swayidle -w \
timeout 60 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' &
swaylock \
--screenshots \
--clock \
--indicator \
--indicator-radius 100 \
--indicator-thickness 7 \
--effect-blur 7x5 \
--effect-vignette 0.5:0.5 \
--ring-color bb00cc \
--key-hl-color 880033 \
--line-color 00000000 \
--inside-color 00000088 \
--separator-color 00000000 \
--grace 2 \
--fade-in 0.2
pkill --newest swayidle

View File

@ -1,10 +0,0 @@
#!/usr/bin/env sh
# Terminate already running bar instances
pkill polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
# Launch polybar
polybar -c /home/tstarr/.config/polybar/dracula &

View File

@ -0,0 +1,36 @@
# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# Uptime
uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f7)
# Date
date_formatted=$(date "+%a %F %H:%M")
# Kernel Version
linux_version=$(uname -r)
# Gamemode status
status=$(gamemoded -s)
if [ "$status" == "gamemode is inactive" ]; then
gamemode=🧊
else
gamemode=🔥
fi
# Volume
sink=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 )
volume=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
mute=$(pactl list sinks | grep '^[[:space:]]Mute:' | head -n $(( $SINK + 1 )) | tail -n 1 | awk '{print $2}')
if [ "$mute" == "yes" ]; then
volume_color='#f92672'
else
volume_color='#ffffff'
fi
#bluetooth=$(bluetoothctl devices | cut -f2 -d' ' | while read uuid; do bluetoothctl info $uuid; done | grep -e "Name\|Connected: yes" | grep -B1 "yes" | head -n 1 | cut -d\ -f2-)
bluetooth="a"
#<span foreground='#c16b26'>lel</span>
echo -e "🫐 $bluetooth | ⬆️ $uptime_formatted | 🔉<span foreground='$volume_color'>$volume%</span> | $gamemode | 🐧 $linux_version | $date_formatted "

View File

@ -1,4 +1,3 @@
#!/bin/bash
CPU_USAGE=$(top -b -n2 -p 1 | fgrep "Cpu(s)" | tail -1 | awk -F'id,' -v prefix="$prefix" '{ split($1, vs, ","); v=vs[length(vs)]; sub("%", "", v); printf "%s%.1f%%\n", prefix, 100 - v }') CPU_USAGE=$(top -b -n2 -p 1 | fgrep "Cpu(s)" | tail -1 | awk -F'id,' -v prefix="$prefix" '{ split($1, vs, ","); v=vs[length(vs)]; sub("%", "", v); printf "%s%.1f%%\n", prefix, 100 - v }')
echo "$CPU_USAGE" echo "$CPU_USAGE"

View File

@ -1,4 +1,3 @@
#! /bin/bash
sink=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 ) sink=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 )
volume=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' ) volume=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )

View File

@ -85,10 +85,9 @@ fi
export PATH export PATH
export PATH=/home/tstarr/.nimble/bin:$PATH export PATH=/home/tstarr/.nimble/bin:$PATH
export PATH=/home/tstarr/.cargo/bin:$PATH #export PATH=/home/tstarr/.cargo/bin:$PATH
#export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" #export PATH="$PATH:$GEM_HOME/bin"
export PATH="$PATH:$GEM_HOME/bin"
export NVM_DIR="$HOME/.nvm" export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

View File

@ -81,23 +81,14 @@
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim vim
neovim
git git
haskellPackages.xmobar
killall killall
pciutils pciutils
syncthing syncthing
nnn #pamixer
xidlehook
pamixer
vifm vifm
play-with-mpv
mpv mpv
autokey
gnome-extension-manager
gnome.gnome-tweaks
pinentry-curses pinentry-curses
ripgrep
trash-cli trash-cli
]; ];
@ -116,8 +107,10 @@
configDir = "/home/tstarr/.config/syncthing"; configDir = "/home/tstarr/.config/syncthing";
}; };
}; };
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
services.pcscd.enable = true; services.pcscd.enable = true;
@ -135,6 +128,7 @@
vfio.enable = false; # Currently broken vfio.enable = false; # Currently broken
}; };
devel = { devel = {
tooling.enable = true;
python.enable = true; python.enable = true;
engineering.enable = true; engineering.enable = true;
}; };

View File

@ -6,6 +6,7 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
google-chrome
firefox firefox
alacritty alacritty
gamemode gamemode

View File

@ -36,14 +36,15 @@ in {
glib # gsettings glib # gsettings
dracula-theme # gtk theme dracula-theme # gtk theme
gnome3.adwaita-icon-theme # default gnome cursors gnome3.adwaita-icon-theme # default gnome cursors
swaylock swaylock-effects
swayidle swayidle
grim # screenshot functionality grim # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer mako # notification system developed by swaywm maintainer
wdisplays # tool to configure displays wdisplays # tool to configure displays
rofip rofi
networkmanagerapplet imagemagick
feh
]; ];
# xdg-desktop-portal works by exposing a series of D-Bus interfaces # xdg-desktop-portal works by exposing a series of D-Bus interfaces

View File

@ -18,6 +18,8 @@ in {
(python3.withPackages my-python-packages) (python3.withPackages my-python-packages)
beancount beancount
fava fava
nodePackages_latest.pyright
distrobox
]; ];
}; };
} }

View File

@ -0,0 +1,18 @@
# coding stuff for all the languages
{ config, lib, pkgs, user, ... }:
let
cfg = config.modules.devel.tooling;
in {
options.modules.devel.tooling.enable = lib.mkEnableOption "tooling";
config = lib.mkIf cfg.enable {
# Install packages
environment.systemPackages = with pkgs; [
neovim
ripgrep
tmuxinator
];
};
}

View File

@ -1,7 +1,5 @@
let sources = import ../nix/sources.nix; in
self: super: { self: super: {
rofi = pkgs.rofi.override { plugins = [ pkgs.rofi-emoji ]; }; rofi = super.rofi.override { plugins = [ self.rofi-emoji ]; };
} }