diff --git a/.emacs b/.emacs new file mode 100644 index 0000000..65aeb4f --- /dev/null +++ b/.emacs @@ -0,0 +1,32 @@ +(defun my-disable-gui-bars (&optional frame) + "Turn off tool-, menu- and scroll‑bars in FRAME (default: current frame)." + (with-selected-frame (or frame (selected-frame)) + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1))) + +;; Apply to the first frame right now +(my-disable-gui-bars) + +;; And to every frame created in the future +(add-hook 'after-make-frame-functions #'my-disable-gui-bars) + +;; Prevent the bars from flickering at startup +(setq default-frame-alist + '((menu-bar-lines . 0) + (tool-bar-lines . 0) + (vertical-scroll-bars . nil))) + +;;(setq inhibit-startup-screen t) + +(global-set-key (kbd "C-w ") #'windmove-left) +(global-set-key (kbd "C-w ") #'windmove-right) +(global-set-key (kbd "C-w ") #'windmove-up) +(global-set-key (kbd "C-w ") #'windmove-down) + +(load-theme 'tango-dark t) + +;;(add-to-list 'default-frame-alist +;; '(font . "Fira Code-14")) + +(setq org-support-shift-select nil) diff --git a/.gitignore b/.gitignore index 577b0a0..21530d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ hardware-configuration.nix +/de/dwm/dwm +/de/st/st +/de/my-tui-utils/my-tui-utils +/de/sxiv/sxiv +/de/dmenu/dmenu +result diff --git a/.keynavrc b/.keynavrc new file mode 100644 index 0000000..75d7966 --- /dev/null +++ b/.keynavrc @@ -0,0 +1,108 @@ +clear + + +Super_L+slash start +Escape end +ctrl+bracketleft end + +j cut-left +k cut-down +l cut-up +semicolon cut-right +u cut-left,cut-up +i cut-right,cut-up +n cut-left,cut-down +m cut-right,cut-down + +shift+j move-left +shift+k move-down +shift+l move-up +shift+semicolon move-right +shift+u move-left,move-up +shift+i move-right,move-up +shift+n move-left,move-down +shift+m move-right,move-down + +space warp,click 1,end +Return warp,click 2,end +slash warp,end +Tab warp +1 click 1 +2 click 2 +3 click 3 + +w windowzoom + +# Zoom to the cursor location +c cursorzoom 400 400 + +# Arrow keys can move the grid as welll +Left cut-left +Down cut-down +Up cut-up +Right cut-right +shift+Left move-left +shift+Down move-down +shift+Up move-up +shift+Right move-right + +a history-back + +# Record keynav actions (Had not tried yet) +q record +shift+at playback + + + + + +### Example using the 'sh' command. +# Make firefox the active window +#f sh "xdotool windowactivate $(xdotool search -title -- '- Mozilla Firefox')", end +# Make a new tab in google chrome: +#t sh "xdotool windowactivate $(xdotool search --title -- '- Google Chrome' | head -1); xdotool key ctrl+t",end +# Paste +#v sh "xdotool key shift+Insert" + +### Drag examples +# Start drag holding the left mouse button +#q drag 1 +# Start drag holding middle mouse + control and shift +#w drag 2 ctrl+shift +# Dragging with modifiers +#q drag 1 +#ctrl+q drag 1 ctrl +#shift+q drag 1 shift +#shift+ctrl+q drag 1 shift+ctrl + +### Example of cut and move without the default values +#h cut-left .75 +#j cut-down .75 +#k cut-up .75 +#l cut-right .75 +#shift+h move-left .50 +#shift+j move-down .50 +#shift+k move-up .50 +#shift+l move-right .50 + +### Example using a 2-row, 3-column grid, +# mapped to Insert/Home/PageUp/etc... +#6 grid 2x3 +#Insert cell-select 1x1 +#Home cell-select 1x2 +#Prior cell-select 1x3 # PageUp +#Delete cell-select 2x1 +#End cell-select 2x2 +#Next cell-select 2x3 # PageDown + +### Example using a 3x3 grid with nethack-vi keys +#ctrl+semicolon start, grid 3x3 +#h cell-select 1x2 # left +#j cell-select 2x3 # down +#k cell-select 2x1 # up +#l cell-select 3x2 # right +#y cell-select 1x1 # up-left +#u cell-select 3x1 # up-right +#b cell-select 1x3 # down-left +#n cell-select 3x3 # down-right +#period cell-select 2x2 # center diff --git a/.lesskey b/.lesskey new file mode 100644 index 0000000..86cbe37 --- /dev/null +++ b/.lesskey @@ -0,0 +1,5 @@ +h noaction +j left-scroll +k forw-line +l back-line +; right-scroll diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..45c187c --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,78 @@ +set -g history-limit 200000 +set -g mouse off +set -g base-index 1 +set -gw pane-base-index 1 +set -g mode-keys emacs +# Previously set to tmux-256color and xterm-256color +set -g default-terminal xterm-256color +set -g escape-time 0 +set -g repeat-time 0 +set -g status on + +set -g status-style bg=#66ccff,fg=black, +set -g window-status-style bg=#ccffff,fg=black +set -g window-status-current-style bg=red,fg=white + +set -g status-left-style fg=black,bold +set -g status-right-style fg=black,bold + +unbind -T copy-mode C-Space +unbind -T copy-mode v +bind -T copy-mode v send-keys -X begin-selection +unbind -T copy-mode C-w +unbind -T copy-mode y +bind -T copy-mode y send-keys -X copy-selection-and-cancel +unbind -T copy-mode Y +bind -T copy-mode Y send-keys -X pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" + +unbind -T copy-mode j +unbind -T copy-mode k +unbind -T copy-mode l +unbind -T copy-mode \; + +bind -T copy-mode j send-keys -X cursor-left +bind -T copy-mode k send-keys -X cursor-down +bind -T copy-mode l send-keys -X cursor-up +bind -T copy-mode \; send-keys -X cursor-right + +%hidden start_command="zsh -l" +%hidden small_resize="3" +%hidden big_resize="13" + +unbind C +unbind c +bind C new-window +bind c new-window $start_command +unbind \" +bind \" split-window -v -c "#{pane_current_path}" $start_command +unbind % +bind % split-window -h -c "#{pane_current_path}" $start_command +unbind Q +bind Q kill-session +# This binding is for gays. I don't use it. Because I'm not gay. +# bind h select-pane -t "{left-of}" +bind j select-pane -L +bind k select-pane -D +bind l select-pane -U +bind \; select-pane -R + +#set -ga terminal-overrides ",*:ctrlsem=\033[69;50S" +#set -ga terminal-overrides ",*:altsem=\033[69;2S" + +set -s user-keys[0] "\e[69;50S" +set -s user-keys[1] "\e[69;2S" +bind -n User0 send-keys "\e[69;50S" +bind -n User1 send-keys "\e[69;2S" + +bind C-j resize-pane -L $small_resize +bind C-k resize-pane -D $small_resize +bind C-l resize-pane -U $small_resize +bind User0 resize-pane -R $small_resize + +bind M-j resize-pane -L $big_resize +bind M-k resize-pane -D $big_resize +bind M-l resize-pane -U $big_resize +bind User1 resize-pane -R $big_resize + + +bind r source-file ~/.tmux.conf \; display "Config reloaded" diff --git a/.vimrc b/.vimrc new file mode 100755 index 0000000..bd952c0 --- /dev/null +++ b/.vimrc @@ -0,0 +1,151 @@ +let g:ctrl_semicolon_key_code="[69;50S" + +set number + +set expandtab +set softtabstop=4 +set tabstop=4 +set shiftwidth=4 +set textwidth=99999999 +set wrapmargin=0 +set nowrap +set formatoptions-=t +set clipboard=unnamedplus +set mouse=n +set noswapfile +set backspace=indent,eol,start +set ttimeoutlen=5 + + +let g:ale_enabled = 0 + +" For YCM +let g:ycm_auto_trigger = 0 +let g:ycm_auto_hover = '' +let g:ycm_signature_help = 0 +let g:ycm_show_diagnostics_ui = 0 +set completeopt=menuone,popup +let g:ycm_server_keep_logfiles = 0 + +"set nocompatible +" filetype off +" set rtp+=~/.vim/bundle/Vundle.vim +"set rtp+=~/.vim/bundle/ale +"set rtp+=~/.vim/bundle/nerdtree +"set rtp+=~/.vim/bundle/vim-airline +"set rtp+=~/.vim/bundle/YouCompleteMe +" filetype plugin indent on + +syntax on +set signcolumn=yes +highlight Normal ctermbg=NONE guibg=NONE +highlight SignColumn term=standout ctermfg=14 ctermbg=37 guifg=Cyan guibg=LightSeaGreen +highlight EndOfBuffer ctermbg=NONE ctermfg=37 guibg=NONE guifg=LightSeaGreen +highlight Pmenu ctermbg=darkblue ctermfg=white +highlight PmenuSel ctermbg=lightblue ctermfg=black + +"nnoremap :YcmCompleter GetDoc +"nnoremap :echo "" +"inoremap (YCMCompleter) +"autocmd User YcmLoaded inoremap (YCMCompleter) +" How bad YCM developers had not thought about ADDING AN ABILITY TO MAP FUNCTIONS +imap +inoremap +nnoremap q + +" For Airline +let g:airline_powerline_fonts = 1 +let g:airline#extensions#keymap#enabled = 0 +let g:airline_section_z = "\ue0a1:%l/%L Col:%c" +let g:Powerline_symbols='unicode' + +" For NERDTree +let g:NERDTreeShowHidden=1 + +nnoremap i :NERDTree5> +nnoremap v :source $MYVIMRC +nnoremap e :vsplit $MYVIMRC +nnoremap w :set wrap:set linebreak +nnoremap y :call system("wl-copy", getreg("@\"")) + +" Close the tab if NERDTree is the only window remaining in it. +autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\:\") | endif + +" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. +autocmd BufEnter * if winnr() == winnr('h') && bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | + \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif + +" Remap cursor movement keys in Normal mode +nnoremap j h +nnoremap k gj +nnoremap l gk +nnoremap ; l +nnoremap h +nnoremap gj +nnoremap gk +execute "nnoremap " . g:ctrl_semicolon_key_code . " l" + +" Remap cursor movement keys in Visual mode +vnoremap j h +vnoremap k gj +vnoremap l gk +vnoremap ; l +vnoremap h +vnoremap gj +vnoremap gk +execute "vnoremap " . g:ctrl_semicolon_key_code . " l" + +" Remap cursor movement keys in Select mode +snoremap j h +snoremap k gj +snoremap l gk +snoremap ; l + +" Remap cursor movement keys in Operator-pending mode +onoremap j h +onoremap k gj +onoremap l gk +onoremap ; l + +" Remap cursor movement keys in Insert mode +inoremap +inoremap g +inoremap g +execute "inoremap " . g:ctrl_semicolon_key_code . " " + +" Remap cursor movement keys in Command-line mode +cnoremap +cnoremap g +cnoremap g +execute "cnoremap " . g:ctrl_semicolon_key_code . " " + +"Remap window movement +nnoremap j h +nnoremap k j +nnoremap l k +nnoremap ; l + +" My custom idea - moving window with the cursor +nnoremap K j +nnoremap L k + +"Navigating tabs +nnoremap j gT +nnoremap ; gt + +"Rearranging tabs +nnoremap J :tabmove -1 +nnoremap : :tabmove +1 + + +"Makefile tab highlight +augroup MakefileTabHighlight + autocmd! + "autocmd FileType make syntax match FirstTab /^\t/ + "autocmd FileType make highlight FirstTab ctermbg=35 ctermfg=35 + autocmd FileType make setlocal noexpandtab + autocmd FileType make setlocal list + autocmd FileType make setlocal lcs=tab:*\ \* + autocmd FileType make highlight SpecialKey ctermbg=35 ctermfg=30 +augroup END + diff --git a/.xinitrc b/.xinitrc new file mode 100755 index 0000000..2cb49ae --- /dev/null +++ b/.xinitrc @@ -0,0 +1,29 @@ +#!/bin/sh + +exec >~/xinitrc.log 2>&1 +set -x + +export GTK_IM_MODULE=fcitx +export QT_IM_MODULE=fcitx +export SDL_IM_MODULE=fcitx +export XMODIFIERS=@im=fcitx + +setxkbmap -layout "us,ru" -option "grp:win_space_toggle" +xset r rate 250 30 +xset b off +xset s off -dpms + +flameshot & +picom & +fcitx5 & +keynav & + +AVD="$HOME/desktop_env/avd" +"$AVD/avdd" & +"$AVD/avds" 'bat,dt,vol-amixer' m true & +"$AVD/avds" 'cpu,mem' 2000 true & + +dwm_random_bg.sh & + +exec dwm + diff --git a/HaskellImportCrib.hs b/HaskellImportCrib.hs new file mode 100644 index 0000000..a874c3d --- /dev/null +++ b/HaskellImportCrib.hs @@ -0,0 +1,66 @@ +-- Module declaration with explicit exports: exports only specified items, hiding others. +-- Here, exporting a function, a type with all constructors, a class, and a module re-export. +module ExampleModule + ( myFunction -- Exports the function myFunction + , MyType(..) -- Exports type MyType and all its constructors/patterns + , class MyClass -- Exports the class MyClass + , module Data.Maybe -- Re-exports everything from Data.Maybe + ) where + +-- Simple import: imports all exported items from Prelude unqualified. +import Prelude + +-- Empty import list: imports nothing explicitly, but allows qualified access if qualified. +import Prelude () + +-- Specific imports: imports only listed items unqualified. +import Prelude (not, (&&)) -- Imports not and && operators. + +-- Import type with specific constructors: imports MyType but only Con1 and Con2. +import ExampleModule (MyType(Con1, Con2)) -- Imports Con1 and Con2 for MyType. + +-- Import type with all constructors: imports MyType and all its constructors. +import ExampleModule (MyType(..)) -- Imports MyType and all constructors/patterns. + +-- Import class: imports the class MyClass. +import ExampleModule (class MyClass) -- Imports MyClass class. + +-- Hiding specific items: imports all from Prelude except not and &&. +import Prelude hiding (not, (&&)) -- Excludes not and && from import. + +-- Qualified import: imports all from Data.List qualified, access via Data.List.name. +import qualified Data.List + +-- Qualified with hiding: imports qualified, excluding intersect. +import qualified Data.List hiding (intersect) -- Excludes intersect, others via Data.List. + +-- Qualified with specific items: imports only sort and length qualified. +import qualified Data.List (sort, length) -- Access via Data.List.sort, Data.List.length. + +-- Import as alias: imports all from Data.Map unqualified, but alias for qualified use. +import Data.Map as M -- Unqualified access, or M. for qualified. + +-- Qualified as alias: imports qualified with alias DM. +import qualified Data.Map as DM -- Access via DM.name. + +-- Qualified as alias with specific items: imports only lookup and insert as DM. +import qualified Data.Map (lookup, insert) as DM -- DM.lookup, DM.insert. + +-- Qualified as alias hiding: imports qualified as DM, hiding delete. +import qualified Data.Map hiding (delete) as DM -- Excludes delete, others via DM. + +-- ghci -i path/to/my/custom/module/ Executable.hs +import MyCustomModule -- Imports from specified source file. + +-- Import safe: imports only safe exports (no unsafePerformIO etc.). +import safe System.IO.Unsafe -- Imports only safe items. + +-- Qualified safe: imports qualified and safe. +import safe qualified System.IO.Unsafe as Unsafe -- Unsafe.name, only safe items. + +-- Import instances: instances are imported automatically with types/classes (no explicit syntax). + +-- Re-exporting: as shown in module header, use module OtherModule to re-export. + +-- Note: Exports control visibility; if not in export list, hidden unless open module. + diff --git a/batshit.sh b/batshit.sh new file mode 100755 index 0000000..4a95f76 --- /dev/null +++ b/batshit.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash + +# From gregory +# I wrote none of this. This script is produced entirely by AI + +# Function to get battery percentage +get_battery_percentage() { + local bat_path="/sys/class/power_supply" + local bat_name="" + + # Find battery directory + for bat in "$bat_path"/BAT*; do + if [ -d "$bat" ]; then + bat_name=$(basename "$bat") + break + fi + done + + if [ -z "$bat_name" ]; then + echo "BATTERY_NOT_FOUND" + return 1 + fi + + local capacity_file="$bat_path/$bat_name/capacity" + if [ ! -r "$capacity_file" ]; then + echo "CAPACITY_READ_FAILED" + return 1 + fi + + local capacity + if ! capacity=$(cat "$capacity_file" 2>/dev/null); then + echo "CAPACITY_READ_FAILED" + return 1 + fi + + # Validate it's a number between 0-100 + if ! echo "$capacity" | grep -qE '^[0-9]+$'; then + echo "CAPACITY_INVALID" + return 1 + fi + + if [ "$capacity" -lt 0 ] || [ "$capacity" -gt 100 ]; then + echo "CAPACITY_INVALID" + return 1 + fi + + echo "$capacity" +} + +# Function to get battery status +get_battery_status() { + local bat_path="/sys/class/power_supply" + local bat_name="" + + # Find battery directory + for bat in "$bat_path"/BAT*; do + if [ -d "$bat" ]; then + bat_name=$(basename "$bat") + break + fi + done + + if [ -z "$bat_name" ]; then + echo "BATTERY_NOT_FOUND" + return 1 + fi + + local status_file="$bat_path/$bat_name/status" + if [ ! -r "$status_file" ]; then + echo "STATUS_READ_FAILED" + return 1 + fi + + local status + if ! status=$(cat "$status_file" 2>/dev/null); then + echo "STATUS_READ_FAILED" + return 1 + fi + + # Validate status is one of expected values + case "$status" in + Charging|Discharging|Full|Unknown|"Not charging") + echo "$status" + ;; + *) + echo "STATUS_UNKNOWN" + return 1 + ;; + esac +} + +# Function to get date +get_date() { + if ! date +%Y-%m-%d 2>/dev/null; then + echo "DATE_FAILED" + return 1 + fi +} + +# Function to get time with seconds +get_time() { + if ! date +%H:%M:%S 2>/dev/null; then + echo "TIME_FAILED" + return 1 + fi +} + +# Main loop +while true; do + # Get all components + battery_percent=$(get_battery_percentage) + battery_status=$(get_battery_status) + current_date=$(get_date) + current_time=$(get_time) + + # Print the line + echo "${battery_percent}% ${battery_status} ${current_date} ${current_time}" + + # Wait 1 second + sleep 1 +done diff --git a/cmus-rc b/cmus-rc new file mode 100644 index 0000000..a4cdfd1 --- /dev/null +++ b/cmus-rc @@ -0,0 +1,40 @@ +set color_win_fg=227 +set color_win_bg=default +set color_cmdline_fg=220 +set color_cmdline_bg=default +set color_error=9 +set color_info=106 +set color_separator=11 +set color_statusline_fg=208 +set color_statusline_bg=default +set color_statusline_progress_fg=162 +set color_statusline_progress_bg=default +set color_titleline_fg=214 +set color_titleline_bg=default +set color_win_title_fg=166 +set color_win_title_bg=default + +set color_win_cur=9 +# When track is hovered and playing +set color_win_cur_sel_fg=88 +set color_win_cur_sel_bg=220 +# When track is playing and selected but not hovered +set color_win_inactive_cur_sel_fg=88 +set color_win_inactive_cur_sel_bg=222 +# When track is not playing and hovered +set color_win_sel_fg=232 +set color_win_sel_bg=190 +# When some track is selected but is not playing and not hovered +set color_win_inactive_sel_fg=232 +set color_win_inactive_sel_bg=172 + +set color_win_dir=155 + +unbind -f common h +bind -f common j seek -5 +bind -f common k win-down +bind -f common l win-up +bind -f common ; seek +5 +bind -f common R source ~/.config/cmus/rc +bind -f common A add -l ~/Music + diff --git a/configuration.nix b/configuration.nix index dcc4f9f..b42ad02 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,11 +1,11 @@ -# nixos-help - { config, pkgs, lib, ... }: - +let home-manager-src = builtins.fetchTarball { + url = "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz"; +}; in { imports = [ ./hardware-configuration.nix -# + (import "${home-manager-src}/nixos") ]; @@ -17,11 +17,43 @@ boot.loader.efi.canTouchEfiVariables = true; nix.settings.experimental-features = [ "nix-command"]; + + boot.extraModulePackages = with config.boot.kernelPackages; [ + v4l2loopback + ]; + + home-manager.users.gregory = import ./home.nix { inherit pkgs; }; environment.systemPackages = with pkgs; [ + #pkgs.python312.withPackages (ps: [ ps.pillow ps.pyftpdlib ps.numpy ]) + python3 python3Packages.numpy python3Packages.pillow python3Packages.pyyaml python3Packages.pyftpdlib + (haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [ + random + ])) + haskell-language-server + cowsay + tagainijisho + djview + djvulibre + convmv + dnsmasq +# linuxKernel.packages.linux_6_12.v4l2loopback + config.boot.kernelPackages.v4l2loopback + cheese + perf + pymol + bedtools + krita + v4l-utils + wf-recorder + wl-screenrec + libime + pencil2d + helix + graphviz + gzdoom bc optipng - #xdg-desktop-portal-wlr i3status waybar qrencode @@ -118,7 +150,7 @@ cmus htop picom - linuxKernel.packages.linux_5_4.wireguard + #linuxKernel.packages.linux_5_4.wireguard wireguard-tools pulsemixer nix-prefetch-git @@ -170,7 +202,7 @@ steam-tui steamcmd - ratpoison + #ratpoison waybar # status bar wl-clipboard @@ -179,29 +211,47 @@ foot ]; - environment.etc."profile.local" = { - text = '' - export EDITOR=vim - ''; + services.logind.settings.Login = { + HandleLidSwitch="ignore"; + HandleLidSwitchExternalPower="ignore"; + HandleLidSwitchDocked="ignore"; }; - environment.etc."zshrc.local".text = builtins.readFile ./zshrc.local; - environment.etc."my_zsh_utils.zsh".text = builtins.readFile ./my_zsh_utils.zsh; + + networking.firewall = { + enable = true; + allowedTCPPorts = [ 5559 5560 5561 ]; + }; + + services.flatpak.enable=true; + + environment.etc."profile.local".text = '' + export EDITOR=vim + ''; services.dbus.enable = true; xdg.portal = { - enable = true; - wlr.enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + enable = true; # Ensure portals are enabled + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk # For 'gtk' backend + xdg-desktop-portal-wlr # For 'wlr' backend + ]; + config.common = { + default = "gtk"; # Default to gtk for all interfaces + "org.freedesktop.impl.portal.Screencast" = "wlr"; + "org.freedesktop.impl.portal.Screenshot" = "wlr"; + }; }; i18n.inputMethod = { enable = true; type = "fcitx5"; + fcitx5.waylandFrontend = true; fcitx5.addons = with pkgs; [ + #qt6Packages.fcitx5-chinese-addons fcitx5-mozc #fcitx5-mozc-ut fcitx5-gtk - fcitx5-configtool + qt6Packages.fcitx5-configtool ]; }; @@ -222,7 +272,7 @@ WLR_NO_HARDWARE_CURSORS = "1"; }; - networking.hostName = "gaminglaptopg"; + networking.hostName = "siliconCan"; networking.networkmanager.enable = true; @@ -283,45 +333,25 @@ openFirewall = true; }; - services.logind.extraConfig = '' - LidSwitchIgnoreInhibited=no - HandleLidSwitch=ignore - ''; + # todo: use services.logind.settings.Login instead + #services.logind.extraConfig = '' + # LidSwitchIgnoreInhibited=no + # HandleLidSwitch=ignore + #''; programs.zsh.enable = true; services.pulseaudio.enable = lib.mkForce false; security.rtkit.enable = true; services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; + wireplumber = { enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - #jack.enable = true; - wireplumber = { - enable = true; - configPackages = [ - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/51-disable-bt-suspend.conf" '' - monitor.bluez.rules = [ - { - matches = [ - { - node.name = "~bluez_input.*" - }, - { - node.name = "~bluez_output.*" - } - ] - actions = { - update-props = { - session.suspend-timeout-seconds = 0 - } - } - } - ] - '') - ]; - }; + }; }; hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; @@ -462,7 +492,7 @@ }; - services.xserver.videoDrivers = [ "amdgpu" "nouveau" ]; + services.xserver.videoDrivers = [ "amdgpu" "nouveau" "intel" ]; #services.xserver.videoDrivers = ["nvidia" "amdgpu" ]; #boot.blacklistedKernelModules = [ diff --git a/de/dmenu/default.nix b/de/dmenu/default.nix new file mode 100644 index 0000000..ae004aa --- /dev/null +++ b/de/dmenu/default.nix @@ -0,0 +1,46 @@ +{ stdenv, lib, pkgs, ... }: + +stdenv.mkDerivation rec { + pname = "dmenu-cust"; + version = "5.3-gregory"; + + #nv1 release + #src = builtins.fetchTarball { + # url = "https://yyyi.ru/suckless-desktop/"; + # sha256 = "04098rrybliw3n4q7wvl78vca1v5nzs2d6r6i89labbp48rap48x"; + #}; + + src = ./dmenu; + + buildPhase = "make all"; + + installPhase = '' + DESTDIR=$out/ make PREFIX=/ install + ''; + + buildInputs = with pkgs; [ + xorg.libX11 + xorg.libXft + xorg.libXrender + fontconfig + freetype + xorg.libXinerama + python311 + ]; + + nativeBuildInputs = with pkgs; [ + gnumake + pkg-config + ]; + + meta = { + description = "Literally coolest program in the world"; + platforms = lib.platforms.linux; + }; + + postPatch = '' + substituteInPlace config.mk \ + --replace "/usr/local" "$out" + ''; +} + diff --git a/de/dwm/default.nix b/de/dwm/default.nix new file mode 100644 index 0000000..83eaa1f --- /dev/null +++ b/de/dwm/default.nix @@ -0,0 +1,37 @@ +{ stdenv, lib, pkgs ? import {}, ... }: + +stdenv.mkDerivation rec { + pname = "dwm-cust"; + version = "6.5-gregory"; + + src = ./dwm; + + buildPhase = "make all"; + + installPhase = '' + DESTDIR=$out/ make PREFIX=/ install + ''; + + buildInputs = with pkgs; [ + xorg.libX11 + xorg.libXft + xorg.libXrender + xorg.libXinerama + fontconfig + freetype + xwallpaper + #(pkgs.callPackage ../st/default.nix {}) + #(pkgs.callPackage ../dmenu/default.nix {}) + ]; + + nativeBuildInputs = with pkgs; [ + gnumake + pkg-config + ]; + + meta = { + description = "My fork of dwm"; + platforms = lib.platforms.linux; + }; +} + diff --git a/de/let_it_happen.sh b/de/let_it_happen.sh new file mode 100755 index 0000000..87a5004 --- /dev/null +++ b/de/let_it_happen.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +[ -f let_it_happen.sh ] || { echo "Wrong directory"; exit 1; } + +sudo rm -rf ./dwm/dwm ./st/st ./my-tui-utils/my-tui-utils ./dmenu/dmenu ./sxiv/sxiv + +sudo cp -r ~/desktop_env/dwm ./dwm/dwm +sudo cp -r ~/desktop_env/st ./st/st +sudo cp -r ~/desktop_env/my-tui-utils ./my-tui-utils/my-tui-utils +sudo cp -r ~/desktop_env/dmenu ./dmenu/dmenu +sudo cp -r ~/desktop_env/sxiv ./sxiv/sxiv + diff --git a/de/my-tui-utils/default.nix b/de/my-tui-utils/default.nix new file mode 100644 index 0000000..df5b7e7 --- /dev/null +++ b/de/my-tui-utils/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, pkgs ? import {}, ... }: + +stdenv.mkDerivation rec { + pname = "my-tui-utils"; + version = "0.1"; + + src = ./my-tui-utils; + + buildPhase = ""; + + installPhase = '' + make PREFIX=$out install + ''; + + buildInputs = with pkgs; [ + python311 + ]; + + nativeBuildInputs = with pkgs; [ + gnumake + pkg-config + ]; + + meta = { + description = "Some cool programs I made on my knees"; + platforms = lib.platforms.linux; + }; +} + diff --git a/de/nethack-gleb/default.nix b/de/nethack-gleb/default.nix new file mode 100644 index 0000000..d4a68de --- /dev/null +++ b/de/nethack-gleb/default.nix @@ -0,0 +1,141 @@ +{ + src, + withRuNethackMemes ? false, + + coreutils, + darwin, + fetchzip, + stdenv, + ncurses, + groff, + lib, + gzip, + gnugrep, + bash, + pkg-config, + pkgs, +# pkgs ? import {} +}: +stdenv.mkDerivation (finalAttrs: { + pname = "nethack"; + version = "3.7-git"; + + src = pkgs.fetchFromGitHub { + owner = "NetHack"; + repo = "NetHack"; + rev = "0f01260605c9393068e07a308840a9b6f8864aa9"; + sha256 = "0d193ycd5yd1sgg64m6w7gqjm8vmfx8vsmrf6vi19idhj6zch72x"; + }; + + luaVersion = "5.4.6"; + luaTarballHash = "sha256-K2dM3q69YuOhlKKE9qTcHFJUVhjlRPxQtKB8ZQOpAyE="; + luaSrc = fetchzip { + name = "lua-src"; + url = "https://www.lua.org/ftp/lua-${finalAttrs.luaVersion}.tar.gz"; + hash = finalAttrs.luaTarballHash; + }; + + platformHint = + { + "aarch64-darwin" = "macOS"; + "x86_64-linux" = "linux"; + } + .${stdenv.hostPlatform.system} or (throw "Unsupported platform: ${stdenv.hostPlatform.system}"); + + #inherit src; + + prePatch = '' + mkdir -p ./lib + cp -r --no-preserve=mode ${finalAttrs.luaSrc} ./lib/lua-${finalAttrs.luaVersion} + ''; + + buildInputs = [ ncurses ]; + + nativeBuildInputs = [ + groff + pkg-config + ]; + + postPatch = '' + sed \ + -e '/^GIT_HASH/d' \ + -e '/^GIT_BRANCH/d' \ + -e '/^SHELLDIR/d' \ + -e '/-DCOMPRESS/s:/bin/gzip:${lib.getExe' gzip "gzip"}:' \ + -i sys/unix/hints/${finalAttrs.platformHint}.370 + + ${lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace sys/unix/hints/${finalAttrs.platformHint}.370 \ + --replace-fail "/usr/bin/true" "${coreutils}/bin/true" \ + --replace-fail "which" "${darwin.shell_cmds}/bin/which" + ''} + + sed \ + -e '/^GDBPATH=/d' \ + -e '/^PANICTRACE_GDB=/s/1/0/' \ + -e '/^GREPPATH=/s:=.*:=${lib.getExe gnugrep}:' \ + -e '/^WIZARDS/s/=.*/=*/' \ + -i sys/unix/sysconf + + ${lib.optionalString withRuNethackMemes '' + sed \ + -e 's/\bluckstone\b/laccstone/g' \ + -e 's/\bhiss\b/zHz/g' \ + -e 's/\bsouls\b/Russel Souls/g' \ + -i $(find -type f) + ''} + ''; + + patches = [ ./unixconf.patch ]; + + configurePhase = '' + sys/unix/setup.sh sys/unix/hints/${finalAttrs.platformHint}.370 + ''; + + postInstall = '' + mkdir $out/bin + cat > $out/bin/nethack << EOF + #! ${lib.getExe bash} + + if [ -z "\$HOME" ]; then + echo "Home directory must be set to play NetHack" >&2 + exit 1 + fi + + export NETHACKVARDIR="\$HOME/.local/share/nethack" + + if [ -e "\$NETHACKVARDIR" ]; then + if [ ! -d "\$NETHACKVARDIR" ]; then + echo "\$NETHACKVARDIR must not be something that is not a directory" >&2 + exit 1 + fi + else + mkdir -p "\$NETHACKVARDIR" + cp -r $out/lib/nethack/vardir/* "\$NETHACKVARDIR" + chmod -R +w "\$NETHACKVARDIR"/* + fi + + $out/lib/nethack/nethack \$@ + EOF + + chmod +x $out/bin/nethack + ''; + + enableParallelBuilding = true; + + NIX_CFLAGS_COMPILE = "-DUSE_DARKGRAY"; + + makeFlags = [ + "GIT=0" + "PREFIX=$(out)" + "HACKDIR=$(out)/lib/nethack" + "VARDIR=$(out)/lib/nethack/vardir" + "WANT_WIN_TTY=1" + "WANT_WIN_CURSES=1" + ]; + + meta = { + mainProgram = "nethack"; + }; +}) + diff --git a/de/nethack-gleb/old-def b/de/nethack-gleb/old-def new file mode 100644 index 0000000..ae1f972 --- /dev/null +++ b/de/nethack-gleb/old-def @@ -0,0 +1,124 @@ +{ + src, + fetchzip, + stdenv, + ncurses, + util-linux, + groff, + lib, + gzip, + gnugrep, + bash, + pkg-config, + pkgs ? import {} +}: +stdenv.mkDerivation (finalAttrs: { + pname = "nethack"; + version = "3.7-git"; + + lua-version = "5.4.6"; + lua-tarball-hash = "sha256-K2dM3q69YuOhlKKE9qTcHFJUVhjlRPxQtKB8ZQOpAyE="; + + srcs = [ + src + (fetchzip { + name = "lua-src"; + url = "https://www.lua.org/ftp/lua-${finalAttrs.lua-version}.tar.gz"; + hash = finalAttrs.lua-tarball-hash; + }) + ]; + + postUnpack = '' + ls && exit 1 + mkdir -p ${finalAttrs.sourceRoot}/lib/ + cp -r --no-preserve=mode lua-src ${finalAttrs.sourceRoot}/lib/lua-${finalAttrs.lua-version} + ''; + + src = pkgs.fetchFromGitHub { + owner = "NetHack"; + repo = "NetHack"; + rev = "0f01260605c9393068e07a308840a9b6f8864aa9"; + sha256 = "0d193ycd5yd1sgg64m6w7gqjm8vmfx8vsmrf6vi19idhj6zch72x"; + }; + + sourceRoot = src.name; + + buildInputs = [ ncurses ]; + + nativeBuildInputs = [ + util-linux + groff + pkg-config + ]; + + postPatch = '' + sed \ + -e '/^GIT_HASH/d' \ + -e '/^GIT_BRANCH/d' \ + -e '/^SHELLDIR/d' \ + -e '/-DCOMPRESS/s:/bin/gzip:${lib.getExe' gzip "gzip"}:' \ + -i sys/unix/hints/linux.370 + + sed \ + -e '/^GDBPATH=/d' \ + -e '/^PANICTRACE_GDB=/s/1/0/' \ + -e '/^GREPPATH=/s:=.*:=${lib.getExe gnugrep}:' \ + -e '/^WIZARDS/s/=.*/=*/' \ + -i sys/unix/sysconf + + sed \ + -e 's/\bluckstone\b/laccstone/g' \ + -e 's/\bhiss\b/zHz/g' \ + -e 's/\bsouls\b/Russel Souls/g' \ + -i $(find -type f) + ''; + + patches = [ ./unixconf.patch ]; + + configurePhase = '' + sys/unix/setup.sh sys/unix/hints/linux.370 + ''; + + postInstall = '' + mkdir $out/bin + cat > $out/bin/nethack << EOF + #! ${lib.getExe bash} + + if [ -z "\$HOME" ]; then + echo "Home directory must be set to play NetHack" >&2 + exit 1 + fi + + export NETHACKVARDIR="\$HOME/.local/share/nethack" + + if [ -e "\$NETHACKVARDIR" ]; then + if [ ! -d "\$NETHACKVARDIR" ]; then + echo "\$NETHACKVARDIR must not be something that is not a directory" >&2 + exit 1 + fi + else + mkdir -p "\$NETHACKVARDIR" + cp -r $out/lib/nethack/vardir/* "\$NETHACKVARDIR" + chmod -R +w "\$NETHACKVARDIR"/* + fi + + $out/lib/nethack/nethack \$@ + EOF + + chmod +x $out/bin/nethack + ''; + + makeFlags = [ + "GIT=0" + "PREFIX=$(out)" + "HACKDIR=$(out)/lib/nethack" + "VARDIR=$(out)/lib/nethack/vardir" + "WANT_WIN_TTY=1" + "WANT_WIN_CURSES=1" + ]; + + meta = { + mainProgram = "nethack"; + }; +}) + diff --git a/de/nethack-gleb/unixconf.patch b/de/nethack-gleb/unixconf.patch new file mode 100644 index 0000000..fb23872 --- /dev/null +++ b/de/nethack-gleb/unixconf.patch @@ -0,0 +1,14 @@ +diff --git a/include/unixconf.h b/include/unixconf.h +index 2c0d133e2..168be776b 100644 +--- a/include/unixconf.h ++++ b/include/unixconf.h +@@ -83,7 +83,7 @@ + * If you want the static parts of your playground on a read-only file + * system, define VAR_PLAYGROUND to be where the variable parts are kept. + */ +-/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */ ++#define VAR_PLAYGROUND getenv("NETHACKVARDIR") + + /* + * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" + diff --git a/de/st/default.nix b/de/st/default.nix new file mode 100644 index 0000000..00b3481 --- /dev/null +++ b/de/st/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, pkgs, ... }: + +# #### +stdenv.mkDerivation rec { + pname = "st-cust"; + version = "0.9.2-gregory"; + + src = ./st; + + buildPhase = "echo $PWD; echo $src; make all"; + + installPhase = '' + DESTDIR=$out/ make PREFIX=/ install + ''; + + buildInputs = with pkgs; [ + xorg.libX11 + xorg.libXft + xorg.libXrender + fontconfig + freetype + ]; + + nativeBuildInputs = with pkgs; [ + gnumake + pkg-config + ]; + + meta = { + description = "Terminal emulator that does not suck dicks."; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + }; + + strictDeps = true; + postPatch = '' + substituteInPlace config.mk \ + --replace "/usr/local" "$out" + ''; +} + diff --git a/de/sxiv/default.nix b/de/sxiv/default.nix new file mode 100644 index 0000000..16289f4 --- /dev/null +++ b/de/sxiv/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, pkgs ? import {}, ... }: + +stdenv.mkDerivation rec { + pname = "sxiv-cust"; + version = "26-gregory"; + + src = ./sxiv; + + buildPhase = "echo $PWD; echo $src; make all"; + + installPhase = '' + DESTDIR=$out/ make PREFIX=/ install + ''; + + buildInputs = with pkgs; [ + xorg.libX11 + xorg.libXinerama + xorg.libXft + xorg.libXrandr + fontconfig + gnumake + pkg-config + freetype + xorg.libXrender + libexif + imlib2 + giflib + + ]; + + nativeBuildInputs = with pkgs; [ + gnumake + pkg-config + ]; + + meta = { + description = "My fork of sxiv image viewer"; + platforms = lib.platforms.linux; + }; + + + strictDeps = true; + postPatch = '' + substituteInPlace Makefile \ + --replace "/usr/local" "$out" + ''; +} + diff --git a/helix-config.toml b/helix-config.toml new file mode 100644 index 0000000..05a865c --- /dev/null +++ b/helix-config.toml @@ -0,0 +1,12 @@ +[keys.normal] +"j" = "move_char_left" +"k" = "move_visual_line_down" +"l" = "move_visual_line_up" +";" = "move_char_right" +#"backspace" = "collapse_selection" + +[keys.select] +"j" = "extend_char_left" +"k" = "extend_visual_line_down" +"l" = "extend_visual_line_up" +";" = "extend_char_right" diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..430c91c --- /dev/null +++ b/home.nix @@ -0,0 +1,105 @@ +{ pkgs, ... }: + +let + userApps = "/home/gregory/.local/share/applications"; +in { + home.username = "gregory"; + home.homeDirectory = "/home/gregory"; + home.stateVersion = "24.11"; + programs.home-manager.enable = true; + #nixpkgs.overlays = [import ./d/overlays.nix ]; + home.packages = with pkgs; [ + (pkgs.callPackage ./de/dwm/default.nix { }) + (pkgs.callPackage ./de/dmenu/default.nix { }) + (pkgs.callPackage ./de/st/default.nix { }) + (pkgs.callPackage ./de/my-tui-utils/default.nix { }) + (pkgs.callPackage ./de/sxiv/default.nix { }) + (pkgs.callPackage ./de/nethack-gleb/default.nix { }) + ]; + + programs.vim = { + enable = true; + plugins = with pkgs.vimPlugins; [ vim-airline nerdtree ]; + extraConfig = builtins.readFile ./.vimrc; + }; + + programs.helix = { + enable = true; + # Add haskell-language-server to Helix's environment + extraPackages = [ pkgs.haskellPackages.haskell-language-server ]; + settings = { + theme = "autumn_night_transparent"; + editor.cursor-shape = { + normal = "block"; + insert = "bar"; + select = "underline"; + }; + }; + languages.language = [ + { + name = "nix"; + auto-format = true; + formatter.command = "${pkgs.nixfmt}/bin/nixfmt"; + } + # Optional: Explicit Haskell configuration + { + name = "haskell"; + auto-format = true; # Uses HLS by default + # language-servers = [ "haskell-language-server-wrapper" ] # This is the default + } + ]; + themes = { + autumn_night_transparent = { + "inherits" = "autumn_night"; + "ui.background" = { }; + }; + }; + extraConfig = builtins.readFile ./helix-config.toml; + }; + + gtk = { + enable = true; + theme = { name = "Adwaita-dark"; }; + }; + + + home.file."${userApps}/st-vim.desktop".text = '' + [Desktop Entry] + Name=ST Vim + Exec=st -e vim %f + Icon=utilities-terminal + Terminal=false + Type=Application + MimeType=text/plain; + Categories=Utility;TextEditor; + ''; + + home.file."${userApps}/firefox-default-release.desktop".text = '' + [Desktop Entry] + Name=Firefox + Exec=firefox -P default-release %u + Icon=firefox + Terminal=false + Type=Application + MimeType=x-scheme-handler/http;x-scheme-handler/https; + Categories=Network;WebBrowser; + ''; + + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "x-scheme-handler/http" = [ "firefox-default-release.desktop" ]; + "x-scheme-handler/https" = [ "firefox-default-release.desktop" ]; + "x-scheme-handler/tg" = [ "org.telegram.desktop.desktop" ]; + "x-scheme-handler/tonsite" = [ "org.telegram.desktop.desktop" ]; + + # Set PDF viewer + "application/pdf" = [ "org.pwmt.zathura.desktop" ]; + + # Set text editor + "text/plain" = [ "st-vim.desktop" ]; + }; + }; +} + diff --git a/imper_files.sh b/imper_files.sh new file mode 100755 index 0000000..3b5fbde --- /dev/null +++ b/imper_files.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +if [ "$USER" != gregory ]; then + echo "Expected to be run as gregory" + exit 1 +fi + +sudo cp zshrc.local /etc/zshrc.local +sudo cp my_zsh_utils.zsh /etc/my_zsh_utils.zsh + +mkdir -p ~/.config/suckless_desktop/ +mkdir -p ~/.config/cmus +mkdir -p ~/.config/sway +mkdir -p ~/.config/swaylock + +cp win_r.dmenu ~/.config/suckless_desktop/ +cp ./.emacs ~/ +cp ./.keynavrc ~/ +cp ./.lesskey ~/ +cp ./cmus-rc ~/.config/cmus/rc +cp ./picom.conf ~/.config/ +cp ./.tmux.conf ~/ + +cp .xinitrc ~/.xinitrc +chmod +x ~/.xinitrc + +cp ./sway-config ~/.config/sway/config +cp ./swaylock-config ~/.config/swaylock/config + +cp ./batshit.sh ~/.config/sway/batshit.sh +chmod +x ~/.config/sway/batshit.sh + +# todo: add mozc and fcitx5 config here + diff --git a/my_zsh_utils.zsh b/my_zsh_utils.zsh index 644daab..361bb00 100644 --- a/my_zsh_utils.zsh +++ b/my_zsh_utils.zsh @@ -1,15 +1,43 @@ #!/bin/zsh +export vfat_mount_flags="-o rw,uid=1000,gid=1000,utf8,iocharset=utf8,codepage=866" + +function take-first-part-media(){ + if [ $# != 3 ]; then + echo "Executed commans: ffmpeg -i \"\$1\" -t \"\$3\" -c copy \"\$2\"" + else + ffmpeg -i "$1" -t "$3" -c copy "$2" + fi +} + +function take-second-part-media(){ + if [ $# != 3 ]; then + echo "Executed commans: ffmpeg -i \"\$1\" -ss \"\$3\" -c copy \"\$2\"" + else + ffmpeg -i "$1" -ss "$3" -c copy "$2" + fi +} + +alias ghci="ghci -Wno-x-partial" + +function nmrescan { + nmcli device wifi rescan +} + function homeREBUILD () { home-manager switch } +function nixZSHELL(){ + nix-shell --command zsh +} + docx_to_pdf () { if [ -z "$1" ]; then echo "docx_to_pdf " 1>&2 - exit 1 + else + libreoffice --headless --convert-to pdf "$1" fi - libreoffice --headless --convert-to pdf "$1" } download-audio(){ @@ -210,4 +238,3 @@ function gitaddacommit { if [ -z "$SSH_AUTH_SOCK" ]; then eval "$(ssh-agent -s)" fi - diff --git a/picom.conf b/picom.conf new file mode 100644 index 0000000..843e955 --- /dev/null +++ b/picom.conf @@ -0,0 +1,27 @@ +# Shadow +shadow=false + +# Fading +fading=true +fade-in-step=0.05 +fade-out-step=0.03 +fade-delta=5 + +# Transparency/Opacity +frame-opacity=1 +#inactive-dim-fixed=false + +# Blur +blur-background=true +blur-kern="11x11gaussian" +blur-strength=5 +#blur-background-fixed=true + +# General Settings +backend="glx" +vsync=true +detect-rounded-corners=true +detect-client-opacity=true +detect-transient=true +use-damage=true + diff --git a/sway-config b/sway-config new file mode 100644 index 0000000..9143856 --- /dev/null +++ b/sway-config @@ -0,0 +1,167 @@ +include /home/gregory/.config/sway/style-autogen + +exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME + +set $mod Mod4 +floating_modifier $mod normal + +bindsym --no-warn --to-code $mod+s exec st -e tmux new-session zsh +bindsym --no-warn --to-code $mod+r exec /home/gregory/.config/suckless_desktop/win_r_out/invoke.sh +bindsym --no-warn --to-code $mod+f1 exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym --no-warn --to-code $mod+f2 exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym --no-warn --to-code $mod+f3 exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym --no-warn --to-code XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym --no-warn --to-code XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym --no-warn --to-code XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym --no-warn --to-code $mod+Shift+s exec swaylock +bindsym --no-warn Print exec flameshot gui --raw | wl-copy +bindsym --no-warn --to-code $mod+Home exec playerctl previous +bindsym --no-warn --to-code $mod+End exec playerctl next +bindsym --no-warn --to-code $mod+Insert exec playerctl play-pause +bindsym --no-warn --to-code XF86AudioPrev exec playerctl previous +bindsym --no-warn --to-code XF86AudioNext exec playerctl next +bindsym --no-warn --to-code XF86AudioPlay exec playerctl play-pause +bindsym --no-warn --to-code Ctrl+XF86AudioStop exec playerctl loop track +bindsym --no-warn --to-code Ctrl+XF86AudioNext exec playerctl loop playlist +bindsym --no-warn --to-code Ctrl+XF86AudioPlay exec playerctl loop playlist +bindsym --no-warn $mod+f4 kill +bindsym --no-warn --to-code $mod+f5 exec brightnessctl set 5%- +bindsym --no-warn --to-code $mod+f6 exec brightnessctl set 5%+ +bindsym --no-warn --to-code XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym --no-warn --to-code XF86MonBrightnessUp exec brightnessctl set 5%+ +bindsym --no-warn --to-code $mod+Ctrl+Shift+f4 exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +bindsym --no-warn --to-code XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + +# --- focus with j k l ; (shifted H J K L to the right) --- +bindsym --no-warn --to-code $mod+j focus left +bindsym --no-warn --to-code $mod+k focus down +bindsym --no-warn --to-code $mod+l focus up +bindsym --no-warn --to-code $mod+semicolon focus right + +# (optional but handy) move containers with Shift + j/k/l/; +bindsym --no-warn --to-code $mod+Shift+j move left +bindsym --no-warn --to-code $mod+Shift+k move down +bindsym --no-warn --to-code $mod+Shift+l move up +bindsym --no-warn --to-code $mod+Shift+semicolon move right + +# --- outputs (screens) --- +# focus another output +bindsym --no-warn --to-code $mod+Ctrl+j focus output left +bindsym --no-warn --to-code $mod+Ctrl+k focus output down +bindsym --no-warn --to-code $mod+Ctrl+l focus output up +bindsym --no-warn --to-code $mod+Ctrl+semicolon focus output right + +# send the focused window to another output (and keep it focused) +bindsym --no-warn --to-code $mod+Ctrl+Shift+j move container to output left +bindsym --no-warn --to-code $mod+Ctrl+Shift+k move container to output down +bindsym --no-warn --to-code $mod+Ctrl+Shift+l move container to output up +bindsym --no-warn --to-code $mod+Ctrl+Shift+semicolon move container to output right + +# --- window layout switching --- +# choose layouts on U / I / O to avoid conflicts +bindsym --no-warn --to-code $mod+u layout tabbed +bindsym --no-warn --to-code $mod+i layout stacking +# toggle split orientation (splith <-> splitv) for the current container +bindsym --no-warn --to-code $mod+o layout toggle split +# prepare the split direction for the *next* split +bindsym --no-warn --to-code $mod+Shift+o split toggle + + +bindsym --no-warn --to-code $mod+b splith +bindsym --no-warn --to-code $mod+v splitv +bindsym --no-warn --to-code $mod+Shift+c reload +bindsym --no-warn --to-code $mod+shift+e exec swaynag -t warning -m 'Do you want to exit sway' -B 'Yes' 'swaymsg exit' +bindsym --no-warn --to-code $mod+f fullscreen +bindsym --no-warn --to-code $mod+a focus parent +# Toggle the current focus between tiling and floating mode +bindsym --no-warn --to-code $mod+Ctrl+space floating toggle +# Swap focus between the tiling area and the floating area +bindsym --no-warn --to-code $mod+Shift+Ctrl+space focus mode_toggle +# 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 + + +bindsym --no-warn $mod+1 workspace number 1 +bindsym --no-warn $mod+2 workspace number 2 +bindsym --no-warn $mod+3 workspace number 3 +bindsym --no-warn $mod+4 workspace number 4 +bindsym --no-warn $mod+5 workspace number 5 +bindsym --no-warn $mod+6 workspace number 6 +bindsym --no-warn $mod+7 workspace number 7 +bindsym --no-warn $mod+8 workspace number 8 +bindsym --no-warn $mod+9 workspace number 9 +bindsym --no-warn $mod+0 workspace number 10 +bindsym --no-warn $mod+Shift+1 move container to workspace number 1 +bindsym --no-warn $mod+Shift+2 move container to workspace number 2 +bindsym --no-warn $mod+Shift+3 move container to workspace number 3 +bindsym --no-warn $mod+Shift+4 move container to workspace number 4 +bindsym --no-warn $mod+Shift+5 move container to workspace number 5 +bindsym --no-warn $mod+Shift+6 move container to workspace number 6 +bindsym --no-warn $mod+Shift+7 move container to workspace number 7 +bindsym --no-warn $mod+Shift+8 move container to workspace number 8 +bindsym --no-warn $mod+Shift+9 move container to workspace number 9 +bindsym --no-warn $mod+Shift+0 move container to workspace number 10 + + +mode "resize" { + bindsym --no-warn --to-code j resize grow left 15px + bindsym --no-warn --to-code k resize grow down 12px + bindsym --no-warn --to-code l resize grow up 12px + bindsym --no-warn --to-code semicolon resize grow right 15px + bindsym --no-warn --to-code Ctrl+j resize grow left 55px + bindsym --no-warn --to-code Ctrl+k resize grow down 40px + bindsym --no-warn --to-code Ctrl+l resize grow up 40px + bindsym --no-warn --to-code Ctrl+semicolon resize grow right 55px + + bindsym --no-warn --to-code Shift+j resize shrink left 15px + bindsym --no-warn --to-code Shift+k resize shrink down 12px + bindsym --no-warn --to-code Shift+l resize shrink up 12px + bindsym --no-warn --to-code Shift+semicolon resize shrink right 15px + bindsym --no-warn --to-code Shift+Ctrl+j resize shrink left 55px + bindsym --no-warn --to-code Shift+Ctrl+k resize shrink down 40px + bindsym --no-warn --to-code Shift+Ctrl+l resize shrink up 40px + bindsym --no-warn --to-code Shift+Ctrl+semicolon resize shrink right 55px + + + bindsym --no-warn Return mode "default" + bindsym --no-warn Escape mode "default" +} + +bindsym --no-warn $mod+w mode "resize" + +mode "party" { + bindsym Escape mode "default" +} + +bindsym $mod+p mode "party" + +bar one { + position top + + status_command ~/.config/sway/batshit.sh + + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} + +bar * colors { + statusline #ff88aa +} + +set $bg ~/Pictures/wallpapers/xdds.jpg +output * bg $bg fill + + +input * repeat_delay 250 +input * repeat_rate 30 + +input * { + xkb_layout "us,ru" + xkb_options "grp:win_space_toggle" +} diff --git a/swaylock-config b/swaylock-config new file mode 100644 index 0000000..e9306c1 --- /dev/null +++ b/swaylock-config @@ -0,0 +1,23 @@ +indicator-radius=120 +indicator-thickness=8 +font=Sans +font-size=18 + +#image=.config/suckless_desktop/wallpaper/wallpaper_empty/shikarnie.png +scaling=fill +color=00ff00ff + + +# indicator + text colors +inside-color=00000080 +ring-color=ffffff80 +line-uses-ring +text-color=ffffffff +key-hl-color=88c0d0ff +bs-hl-color=bf616aff +separator-color=ffffff33 + +# layout label (if you show it) +layout-bg-color=00000080 +layout-text-color=ffffffff +layout-border-color=00000000 diff --git a/win_r.dmenu b/win_r.dmenu new file mode 100644 index 0000000..8a79a6f --- /dev/null +++ b/win_r.dmenu @@ -0,0 +1,127 @@ +dmenu `Запущу программу =>` ( + import options `local.dmenul` + option `nethack` eval `st -e nethack` + option `pencil2d` eval `pencil2d` + option `gzdoom` eval `gzdoom` + option `pactl unload shit` eval `pactl unload-module module-suspend-on-idle` + option `tagainijisho` eval `tagainijisho` + option `vibecheck` eval `st -e ping 8.8.8.8` + option `full brightness` eval `brightnessctl set 100%` + option `night mode` eval `brightnessctl set 30%` + option `play` eval `playerctl play` + option `pause` eval `playerctl pause` + option `next track` eval `playerctl next` + option `prev track` eval `playerctl prev` + option `repeat current track` eval `playerctl loop track` + option `play playlist` eval `playerctl loop playlist` + option `geogebra` eval `geogebra` + option `vpnup` eval `wg-quick up $WG_VPN_NAME` + option `vpndown` eval `wg-quick down $WG_VPN_NAME` + option `firefox` eval `firefox -P "$FF_MAIN_PROFILE"` + option `nmtui` eval `st -e nmtui` + option `alsamixer` eval `st -e alsamixer` + option `bctl` eval `st -e sh -c 'sudo rfkill unblock all && bluetoothctl'` + option `bluetoothctl` eval `st -e sh -c 'sudo rfkill unblock all && bluetoothctl'` + option `cmus` eval `st -e cmus` + option `tui colors` eval `st_show_stuff.sh tui_colors.py` + option `flex` eval `st_show_stuff.sh neofetch` + option `calc` eval `st -e calc` + option `htop` eval `st -e htop` + option `cal` eval `st_show_stuff.sh cal` + option `pulsemixer` eval `st -e pulsemixer` + option `dwm_random_bg.sh` eval `dwm_random_bg.sh` + option `edit` dmenu `Отредактирую файл ::>` ( + option `win_r` eval `st -e sh -c 'cd /etc/nixos && sudo vim win_r.dmenu'` + option `nixos config` eval `st -e sh -c 'cd /etc/nixos && sudo vim configuration.nix'` + option `zutils` eval `st -e sh -c 'cd /etc/nixos && sudo vim my_zsh_utils.zsh'` + + option `sway config` eval `st -e sh -c 'cd /etc/nixos && sudo vim sway-config'` + option `cmus rc` eval `st -e sh -c 'cd /etc/nixos && sudo vim cmus-rc'` + option `tmux config` eval `st -e sh -c 'cd /etc/nixos && sudo vim .tmux.conf'` + + option `local zshrc` eval `st -e sh -c 'cd ~/ && vim .zshrc'` + option `local win_r` eval `st -e sh -c 'cd ~/.config/suckless_desktop && vim local.dmenul'` + option `local win_r init_shell.sh` eval `st -e sh -c 'cd ~/.config/suckless_desktop && vim init_shell.sh'` + ) + + option `recompile this` eval `dmenuc.py ~/.config/suckless_desktop/win_r.dmenu ~/.config/suckless_desktop/win_r_out/ init_shell.sh` + option `reboot` dmenu `ПЕРЕЗАГРУЗИТЬ компьютер?` ( + option `y да` eval `sudo reboot` + option `n нет` eval `` + ) + option `shitdown` dmenu `ВЫКЛЮЧИТЬ компьютер?` ( + option `y да` eval `sudo shutdown -h 0` + option `n нет` eval `` + ) + option `tor browser` eval `tor-browser` + option `fix xorg keyboard` eval `sh -c 'setxkbmap -layout "us,ru" -option "grp:win_space_toggle"; xset r rate 250 30; xset b off; xset s off -dpms'` + + + option `взломать пентагон` dmenu `ВЗЛОМ ПЕНТАГОНА 1%` ( + option `подключиться к сети america rules` dmenu `ВЗЛОМ ПЕНТАГОНА 3%` ( + option `похитить ssh ключ от холодильника Трампа` dmenu `ВЗЛОМ ПЕНТАГОНА 6%` ( + option `скачать маску анонимуса онлайн` dmenu `ВЗЛОМ ПЕНТАГОНА 8%` ( + option `врубить ИНТЕРНАЦИОНАЛ EARRAPE VERSION` dmenu `ВЗЛОМ ПЕНТАГОНА 9%` ( + option `redirect default sink to pentagon alarms` dmenu `ВЗЛОМ ПЕНТАГОНА 18%` ( + option `уронить сервис раздачи оружия для детей` dmenu `ВЗЛОМ ПЕНТАГОНА 23%` ( + option `resurrect_sadam_hussein.py` dmenu `ВЗЛОМ ПЕНТАГОНА 30%` ( + option `ssh elon.musk@tesla.gov` dmenu `ВЗЛОМ ПЕНТАГОНА 30%` ( + option `password: 123456 zig hail` dmenu `Wrong password ВЗЛОМ ПЕНТАГОНА 29%` ( + option `password: maga09876` dmenu `Wrong password ВЗЛОМ ПЕНТАГОНА 28%` ( + option `password: I.Love.Trump` dmenu `ВЗЛОМ ПЕНТАГОНА 36%` ( + option `Слить переписку Трампа с Эпштейном` dmenu `ВЗЛОМ ПЕНТАГОНА 39%` ( + option `кинуть 6yo_girls.zip главе ЦРУ (там зип бомба)` dmenu `ВЗЛОМ ПЕНТАГОНА 46%` ( + option `concern head of CIA with the security of his shit` dmenu `ВЗЛОМ ПЕНТАГОНА 50%` ( + option `На всех компах: настройки локали > выбрать километры` dmenu `ВЗЛОМ ПЕНТАГОНА 59%` ( + option `удалить chrome со всех компьютеров` dmenu `ВЗЛОМ ПЕНТАГОНА 63%` ( + option `запустить восстановление удалённых файлов` dmenu `ВЗЛОМ ПЕНТАГОНА 66%` ( + option `cd .top-secret` dmenu `ВЗЛОМ ПЕНТАГОНА 67%` ( + option `Идти в папку всех агентов ЦРУ за вё время` dmenu `ВЗЛОМ ПЕНТАГОНА 68%` ( + option `Находим там 'Усама Бен Ладен.docx'` dmenu `Так-так-так ВЗЛОМ ПЕНТАГОНА 69%` ( + option `cd ../contract-records` dmenu `Некоторые из них подписаны кровью` ( + option `apt-get install freebsd-bloodmagic-cryptography` dmenu `ВЗЛОМ ПЕНТАГОНА 70%` ( + option `Находим контракт между Бушем и Антихристом` dmenu `ВЗЛОМ ПЕНТАГОНА 71%` ( + option `Сливаем всё-всё в даркнет` dmenu `ВЗЛОМ ПЕНТАГОНА 76%` ( + option `Сотни тысяч людей штурмуют пентагон в четверг` dmenu `ВЗЛОМ ПЕНТАГОНА 93%` ( + option `Ворваться в здание вместе с толпой` dmenu `ВЗЛОМ ПЕНТАГОНА 96%` ( + option `Бежим в бункер с air-gapped серверами фури порна` dmenu `ВЗЛОМ ПЕНТАГОНА 97%` ( + option `air-gapped значит тут 30 метров бетона` dmenu `ВЗЛОМ ПЕНТАГОНА 90%` ( + option `Похуй. Грызть бетон` dmenu `ВЗЛОМ ПЕНТАГОНА 95%` ( + option `Подключиться к серверу с фурри-порном` dmenu `ВЗЛОМ ПЕНТАГОНА 99%` ( + option `Забрать всю казну США себе` dmenu `ВЗЛОМ ПЕНТАГОНА 100%` ( + option `Покинуть пентагон. Разрушить экономику США` eval `st_show_stuff.sh echo "ПЕНТАГОН ВЗЛОМАН. We own the shit. Доллар стоит 0 рублей"` + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +) +