commit 19358819576bdf87750a0e535ff0982409877040 Author: Violet Truchseß Date: Sun Feb 4 17:06:53 2024 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c75523b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +flake.lock +sway/device-config +device-conf.nix diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7e579e8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "private"] + path = private + url = ./private/ diff --git a/borg/backup.sh b/borg/backup.sh new file mode 100755 index 0000000..a101c65 --- /dev/null +++ b/borg/backup.sh @@ -0,0 +1,73 @@ +#! /usr/bin/env bash + +set -e + +if [ -z "$1" ] +then + REPO="nas:~/borg" + LOCAL=false +else + DISK="$1" + LOCAL=true +fi + +if $LOCAL +then + #check if unlocked + if [ -e "/dev/disk/by-label/$DISK" ] + then + echo "Disk already unlocked" + else + udisksctl unlock -b /dev/disk/by-partlabel/$DISK --key-file "$HOME/.keys/luks.key" + fi + #check if mounted + if [ -e "/run/media/$USER/$DISK" ] + then + echo "Disk already mounted" + else + udisksctl mount -b /dev/disk/by-label/$DISK + fi + REPO="/run/media/$USER/$DISK/borg" +fi + + +ARCHIVE="$REPO::$HOSTNAME-$(date +%Y-%m-%dT%T)" +SRC="$HOME" +BORG_PASSPHRASE="" +echo "Enter passphrase for $REPO:" +read -s BORG_PASSPHRASE +export BORG_PASSPHRASE + +borg create --progress --stats --exclude-caches \ +--exclude $HOME/VirtualBox\ VMs \ +--exclude $HOME/.cache \ +--exclude $HOME/Downloads \ +--exclude $HOME/Photos \ +--exclude $HOME/Videos \ +--exclude $HOME/tmp \ +--exclude $HOME/.local/Steam \ +--exclude $HOME/.local/share/Steam \ +$ARCHIVE $SRC && if ! $LOCAL; then date +%s > $HOME/.lastbak; fi + + + +borg prune --stats --list --keep-within 1d --glob-archives "$HOSTNAME*" \ + -d 7 \ + -w 4 \ + -m 12 \ + -y 3 \ + $REPO + +if $LOCAL && [ $HOSTNAME == "gridlock" ] +then + echo "backing up Photo archive..." + cd "/run/media/$USER/$DISK/photos" + git annex sync + set +e + git annex mirror --from=nas-archive + set -e + git annex sync + cd / + udisksctl unmount -b "/dev/disk/by-label/$DISK" + udisksctl lock -b "/dev/disk/by-partlabel/$DISK" +fi diff --git a/borg/bakage.sh b/borg/bakage.sh new file mode 100755 index 0000000..8f45439 --- /dev/null +++ b/borg/bakage.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +last=$(cat $HOME/.lastbak) +time=$(date +%s) + +age_s=$(( $time - $last )) +age=$(( $age_s / 86400 )) + +echo $age diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d93194e --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Home Manager configuration of vi"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations."vi" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..8f72ff8 --- /dev/null +++ b/home.nix @@ -0,0 +1,321 @@ +{ config, pkgs, lib, ... }: + +{ + + imports = [ + ./device-conf.nix + private/private.nix + ]; + + home.username = "vi"; + home.homeDirectory = "/home/vi"; + home.stateVersion = "23.11"; # Please read the comment before changing. + + home.packages = with pkgs; [ + sshfs + hledger + extremetuxracer + superTux + superTuxKart + pinentry + evolution + w3m + nmap + nb + asciidoctor-with-extensions + simple-scan + paperwork + xsane + dnsutils +# inetutils + shotwell + lua54Packages.lua + lua54Packages.fennel + entr + zathura + swayimg + texliveSmall + vlc + quodlibet + ffmpeg + mosh + openscad + openscad-lsp + pandoc + lynx + neofetch + telegram-desktop + git-annex + python3 + eza + bat + fzf + ripgrep + wl-clipboard + foot + git + waybar + wofi + signal-desktop + element-desktop +# thunderbird + keepassxc + glib + gsettings-desktop-schemas + themechanger + gnome.seahorse + pavucontrol + dunst + libreoffice + borgbackup + gnupg + ]; + programs.alacritty = { + enable = true; + settings = { + env.TERM = "xterm"; + window.opacity = 0.9; + font.normal = { + family = "Hack Nerd Font Mono"; + style = "Regular"; + }; + colors.primary = { + foreground = "#fc28c3"; + background = "#230038"; + }; + }; + }; + programs.starship = { + enable = true; + enableZshIntegration = true; + enableFishIntegration = true; + settings = { + add_newline = false; + format = "$username$hostname $directory$all"; + directory.style = "bold bright-blue"; + username.show_always = true; + username.format = "[$user]($style)"; + username.style_user = "bold bright-purple"; + hostname.ssh_only = false; + hostname.format = "[@$hostname$ssh_symbol]($style)"; + hostname.style = "bold bright-purple"; + character = { + success_symbol = "[>>](bold light-green)"; + error_symbol = "[>>](bold red)"; + }; + line_break.disabled = true; + cmd_duration.disabled = true; + }; + }; + home.file = { + ".config/sway/xenia.png".source = ./xenia.png; + "waybar" = { + source = ./waybar; + target = ".config/waybar"; + recursive = true; + onChange = "/run/current-system/sw/bin/swaymsg reload"; + }; + ".config/gtk-3.0/settings.ini".text = '' + [Settings] + gtk-application-prefer-dark-theme=1 + ''; + ".config/wofi/config".text = '' + show=drun + drun-print_command=true + ''; + ".borg" = { + source = ./borg; + recursive = true; + }; + "scripts" = { + source = ./scripts; + recursive = true; + }; + }; + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + LEDGER_FILE = "$HOME/hledger/hledger.journal"; + }; + + wayland.windowManager.sway.enable = true; + wayland.windowManager.sway.package = pkgs.swayfx; + wayland.windowManager.sway.config = { + bars = [{ + command = "waybar"; + position = "top"; + }]; + colors.focused = { + border = "#ef5ffc"; + background = "#ef5ffc"; + text = "#333333"; + indicator = "#2e9ef4"; + childBorder = "#ef5ffc"; + }; + defaultWorkspace = "1"; + floating = { + criteria = [ + { + app_id = "org.keepassxc.KeePassXC"; + } + ]; + }; + gaps = { + inner = 8; + smartBorders = "on"; + smartGaps = true; + }; + input = { + "type:keyboard" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + xkb_options = "caps:escape,compose:102,shift:both_capslock,eurosign:e"; + }; + }; + keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + menu = config.wayland.windowManager.sway.config.menu; + in lib.mkOptionDefault { + "${modifier}+space" = "exec ${menu}"; + "${modifier}+Control+Space" = "focus mode_toggle"; + "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "XF86Launch1" = "exec ~/scripts/sunset.sh"; + "${modifier}+Control+p" = "exec swaylock -f -c ef5ffc"; + }; + menu = "wofi -G | xargs swaymsg exec --"; + modifier = "Mod4"; + output = { + "*" = { + bg = "~/.config/sway/xenia.png fill"; + }; + }; + window.titlebar = false; + terminal = "alacritty"; + window.border = 2; + }; + wayland.windowManager.sway.extraConfig = '' + blur enable + blur_xray disable + corner_radius 4 + shadows enable + default_dim_inactive 0.1 + dim_inactive_colors.unfocused #fc28c3 + include ~/.config/sway/device-conf + ''; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + programs.fish.enable = true; + home.shellAliases = { + ls = "exa --git"; + ll = "exa --git -l"; + la = "exa --git -al"; + tt = "exa --git -Tl"; + g = "git"; + cat = "bat"; + backup = "$HOME/.borg/backup.sh"; + grep = "rg"; + fox = "cat"; + }; + programs.neovim = { + enable = true; + defaultEditor = true; + extraConfig = '' + set number + + set listchars=tab:>-,trail:~,extends:>,precedes:< + set list + + set expandtab + set tabstop=2 + set shiftwidth=2 + + set autoindent + + set colorcolumn=80 + + set cursorline + set mouse=a + + set clipboard=unnamedplus + + set nocompatible + filetype plugin on + syntax on + + call plug#begin('~/.vim/plugged') + Plug 'mattn/calendar-vim' + call plug#end() + + nnoremap :Neotree + + nnoremap + + nnoremap :tabprevious + nnoremap :tabnext + nnoremap :tabnew + let g:airline_theme='violet' + set modeline + autocmd FileType markdown set textwidth=80 + autocmd FileType asciidoc set textwidth=80 + set scrolloff=5 + + let g:org_agenda_files = ['~/org/*.org'] + + tnoremap + ''; + plugins = with pkgs.vimPlugins; [ + vim-speeddating + indentLine + nightfox-nvim + vim-airline + vim-airline-themes + neo-tree-nvim + syntastic + ale + surround-nvim + fennel-vim + vim-orgmode + ]; + extraLuaConfig = '' + require("nightfox").setup({ + palettes = { + duskfox = { + bg1 = "#230038", + fg1 = "#fc28c3", + } + } + }) + vim.cmd("colorscheme duskfox") + ''; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + }; + + services.gpg-agent.enable = true; + services.syncthing.enable = true; + services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "/run/current-system/sw/bin/swaylock -f -c ef5ffc"; + } + ]; + timeouts = [ + { + command = "/run/current-system/sw/bin/swaylock -f -c ef5ffc"; + timeout = 300; + } + { + command = "swaymsg \"output * dpms off\""; + resumeCommand = "swaymsg \"output * dpms on\""; + timeout = 600; + } + ]; + }; +} diff --git a/private b/private new file mode 160000 index 0000000..68450a4 --- /dev/null +++ b/private @@ -0,0 +1 @@ +Subproject commit 68450a4a611c5da63e664bf06b42f68a1a90118d diff --git a/scripts/sunset.sh b/scripts/sunset.sh new file mode 100755 index 0000000..31ebaaf --- /dev/null +++ b/scripts/sunset.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +RM="/run/current-system/sw/bin/rm" +KILL="/run/current-system/sw/bin/kill" +WLSUNSET="/home/vi/.nix-profile/bin/wlsunset" +ECHO="/run/current-system/sw/bin/echo" +CAT="/run/current-system/sw/bin/cat" +PIDFILE="/tmp/$USER-$EUID-wlsunset.pid" + +if [ -e $PIDFILE ] +then + $KILL $($CAT $PIDFILE) + $RM $PIDFILE +else + $WLSUNSET -l 49 -L 9 & + wlpid=$! + $ECHO $wlpid > $PIDFILE +fi diff --git a/sway/.gitignore b/sway/.gitignore new file mode 100644 index 0000000..f84b392 --- /dev/null +++ b/sway/.gitignore @@ -0,0 +1 @@ +./device-config diff --git a/sway/bg.jpg b/sway/bg.jpg new file mode 100644 index 0000000..078b4cb Binary files /dev/null and b/sway/bg.jpg differ diff --git a/sway/config b/sway/config new file mode 100644 index 0000000..6ebb9f8 --- /dev/null +++ b/sway/config @@ -0,0 +1,249 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu wofi -G | xargs swaymsg exec -- +# set $menu dmenu_path | dmenu | xargs swaymsg exec -- + +include /etc/sway/config-vars.d/* + +### Output configuration +# +# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) +output * bg ~/.config/sway/xenia.png fill +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +exec swayidle -w \ + timeout 300 'swaylock -f -c ef5ffc' \ + timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c ef5ffc' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +input "type:keyboard" { + xkb_layout de + xkb_options caps:swapescape +} + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+space exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+ctrl+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + + + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + + swaybar_command waybar + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. + status_command while date +'%Y-%m-%d %H:%M:%S %p'; do sleep 1; done + + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} + +bindsym $mod+ctrl+p exec swaylock -f -c ef5ffc + +gaps inner 8 +smart_borders on +smart_gaps on +client.focused #ef5ffc #ef5ffc #333333 +default_border pixel 2 + +for_window [app_id="org.keepassxc.KeePassXC"] floating enable +for_window [app_id="nm-connection-editor"] floating enable + +bindsym XF86Launch1 exec bash ~/scripts/sunset.sh + +exec rm ~/.wlsunset.pid +exec bash ~/scripts/sunset.sh + +include /etc/sway/config.d/* diff --git a/sway/desktop b/sway/desktop new file mode 100644 index 0000000..92dee6b --- /dev/null +++ b/sway/desktop @@ -0,0 +1 @@ +output * scale 1.5 diff --git a/tower.nix b/tower.nix new file mode 100644 index 0000000..a9cc5c9 --- /dev/null +++ b/tower.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: + +{ + home.packages = with pkgs; [ + darktable + ]; + home.file.".config/sway/device-conf".text = '' + output * scale 1.5 + ''; +} diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..0c7b218 --- /dev/null +++ b/waybar/config @@ -0,0 +1,173 @@ + +{ + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 24, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 4, // Gaps between modules (4px) + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/window", "sway/mode"], + "modules-center": [ ], + "modules-right": ["idle_inhibitor", "pulseaudio", "custom/backup", "battery", "network", "clock", "tray"], + // Modules configuration + // "sway/workspaces": { + // "disable-scroll": true, + // "all-outputs": true, + // "format": "{name}: {icon}", + // "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "", + // "5": "", + // "urgent": "", + // "focused": "", + // "default": "" + // } + // }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "sway/scratchpad": { + "format": "{icon} {count}", + "show-empty": false, + "format-icons": ["", ""], + "tooltip": true, + "tooltip-format": "{app}: {title}" + }, + "mpd": { + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", + "format-disconnected": "Disconnected ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "off": " ", + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "format": "{:%a, %d.%m - %H:%M}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": "🔇 {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + }, + "custom/backup": { + "format": "{} d", + "exec": "$HOME/.borg/bakage.sh", + "interval": 30 + } +} +// vim: ft=json diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..ad00f0f --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,290 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Ubuntu, FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: #ef5ffc; + border-bottom: #a15ffc; + color: #383333; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 2; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #fc5fbb; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #333333; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #a15ffc; + box-shadow: inset 0 -3px #fc5fbb; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#custom-backup, +#mpd { + padding: 0 10px; + color: #333333; + background-color: #a15ffc; + border-radius: 8; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +/* +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} +*/ + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +/* +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} +*/ + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +/* +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} +*/ +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +/* +#idle_inhibitor { + background-color: #2d3436; +} +*/ + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +} diff --git a/x230.nix b/x230.nix new file mode 100644 index 0000000..9298c34 --- /dev/null +++ b/x230.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + home.packages = with pkgs; [ + wlsunset + ]; + wayland.windowManager.sway.config = { + startup = [ + { command = "bash ~/scripts/sunset.sh"; } + ]; + }; +} diff --git a/xenia.png b/xenia.png new file mode 100644 index 0000000..ad8e53f Binary files /dev/null and b/xenia.png differ