1
0
mirror of https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git synced 2025-09-15 09:45:58 +03:00

first commit

This commit is contained in:
XNM
2023-09-28 03:29:43 +03:00
commit 9124fc4fc7
136 changed files with 11135 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
alias conf="z ~/.config"
alias nixos="z /etc/nixos"
alias store="z /nix/store"
alias nswitch="sudo nixos-rebuild switch --flake .#"
alias nswitchu="sudo nixos-rebuild switch --flake .# --upgrade"
alias ncsu="sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos"
alias nsgc="sudo nix-store --gc"
alias ncg="sudo nix-collect-garbage -d"
# if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]
# exec Hyprland
# end
set -gx EDITOR hx
set -gx VOLUME_STEP 5
set -gx BRIGHTNESS_STEP 5
set fish_vi_force_cursor
set fish_cursor_default block
set fish_cursor_insert line blink
set fish_cursor_visual underscore blink
set -Ux FZF_DEFAULT_OPTS "\
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"
starship init fish | source
zoxide init fish | source

View File

@@ -0,0 +1,32 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export FZF_DEFAULT_OPTS:\x2d\x2dcolor\x3dbg\x2b\x3a\x23363a4f\x2cbg\x3a\x2324273a\x2cspinner\x3a\x23f4dbd6\x2chl\x3a\x23ed8796\x20\x2d\x2dcolor\x3dfg\x3a\x23cad3f5\x2cheader\x3a\x23ed8796\x2cinfo\x3a\x23c6a0f6\x2cpointer\x3a\x23f4dbd6\x20\x2d\x2dcolor\x3dmarker\x3a\x23f4dbd6\x2cfg\x2b\x3a\x23cad3f5\x2cprompt\x3a\x23c6a0f6\x2chl\x2b\x3a\x23ed8796
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d111
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

View File

@@ -0,0 +1,33 @@
function airplane_mode_toggle
set backup_file ~/.cache/airplane_backup
if test -e $backup_file
# Read network states from the backup file
set -l wifi_status (cat $backup_file | grep -o 'wifi:\(on\|off\)$' | cut -d':' -f2)
set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2)
# Restore network states
if test "$wifi_status" = "on"
nmcli radio wifi on
# else
# nmcli radio wifi off
end
if test "$bluetooth_status" = "on"
rfkill unblock bluetooth
# else
# rfkill block bluetooth
end
# Remove the backup file
rm $backup_file
else
# Backup the current network states and turn off all networks
echo "wifi:$(rfkill list wifi | grep -q "Soft blocked: no" && echo "on" || echo "off")" > $backup_file
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >> $backup_file
# Add more lines to backup other network types if needed
nmcli radio wifi off
rfkill block bluetooth
end
end

View File

@@ -0,0 +1,9 @@
function bluetooth_toggle
set bluetooth_status (rfkill list bluetooth | grep -i -o "Soft blocked: yes")
if [ -z "$bluetooth_status" ]
rfkill block bluetooth
else
rfkill unblock bluetooth
end
end

View File

@@ -0,0 +1,10 @@
function bookmark_add
if [ -z $(wl-paste) ]
dunstify "Bookmarks" "Can`t add empty space" -u critical -t 2000
else if grep -q "^$(wl-paste)\$" .bookmarks
dunstify "Bookmarks" "Bookmark '$(wl-paste)' already exists" -u critical -t 2000
else
wl-paste >> .bookmarks;
dunstify "Bookmarks" "Bookmark '$(wl-paste)' was added" -t 2000
end
end

View File

@@ -0,0 +1,7 @@
function bookmark_delete
set bookmark $(cat .bookmarks | rofi -dmenu -p 'delete bookmark')
if not [ -z $bookmark ]
sed -i -e /$bookmark/d .bookmarks
dunstify "Bookmarks" "Bookmark '$bookmark' was deleted" -t 2000
end
end

View File

@@ -0,0 +1,3 @@
function bookmark_to_type
cat .bookmarks | rofi -dmenu -p bookmarks | tr -d '\n' | wtype -
end

View File

@@ -0,0 +1,9 @@
function check_airplane_mode
set backup_file ~/.cache/airplane_backup
if test -e $backup_file
echo "{ \"text\":\"󰀝\", \"tooltip\": \"airplane-mode <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
else
echo "{ \"text\":\"󰀞\", \"tooltip\": \"airplane-mode <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
end
end

View File

@@ -0,0 +1,7 @@
function check_geo_module
set target_process "geoclue"
if pgrep $target_process > /dev/null
echo "{\"text\":\"󰆤\", \"tooltip\":\"Geopositioning\", \"alt\":\"Geo\"}"
end
end

View File

@@ -0,0 +1,9 @@
function check_night_mode
set target_process "gammastep"
if pgrep $target_process > /dev/null
echo "{ \"text\":\"󱩌\", \"tooltip\": \"night-mode <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
else
echo "{ \"text\":\"󱩍\", \"tooltip\": \"night-mode <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
end
end

View File

@@ -0,0 +1,7 @@
function check_recording
set target_process "wf-recorder"
if pgrep $target_process > /dev/null
echo "{\"text\":\"\", \"tooltip\":\"Recording\", \"alt\":\"Recording\"}"
end
end

View File

@@ -0,0 +1,5 @@
function clipboard_clear
rm "$HOME/.cache/cliphist/db"
cb clr -a
dunstify "Clipboard" "Cleared" -t 2000
end

View File

@@ -0,0 +1,7 @@
function clipboard_delete_item
set clip $(cliphist list | rofi -dmenu -p 'clipboard delete item')
if not [ -z $clip ]
echo $clip | cliphist delete
dunstify "Clipboard" "Clip '$clip' was deleted" -t 2000
end
end

View File

@@ -0,0 +1,3 @@
function clipboard_to_type
cliphist list | rofi -dmenu -p clipboard | cliphist decode | wtype -
end

View File

@@ -0,0 +1,7 @@
function clipboard_to_wlcopy
set clip $(cliphist list | rofi -dmenu -p 'clipboard copy')
if not [ -z $clip ]
echo $clip | cliphist decode | wl-copy
dunstify "Clipboard" "Clip '$clip' was copied" -t 2000
end
end

View File

@@ -0,0 +1,20 @@
function dunst_pause
set COUNT_WAITING (dunstctl count waiting)
set COUNT_DISPLAYED (dunstctl count displayed)
set ENABLED "{ \"text\": \"󰂜\", \"tooltip\": \"notifications <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
set DISABLED "{ \"text\": \"󰪑\", \"tooltip\": \"notifications <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
if [ $COUNT_DISPLAYED != 0 ]
set ENABLED "{ \"text\": \"󰂚$COUNT_DISPLAYED\", \"tooltip\": \"$COUNT_DISPLAYED notifications\", \"class\": \"on\" }"
end
if [ $COUNT_WAITING != 0 ]
set DISABLED "{ \"text\": \"󰂛$COUNT_WAITING\", \"tooltip\": \"(silent) $COUNT_WAITING notifications\", \"class\": \"off\" }"
end
if dunstctl is-paused | rg -q "false"
echo $ENABLED
else
echo $DISABLED
end
end

View File

@@ -0,0 +1,3 @@
function fetch_music_player_data
playerctl -a metadata --format "{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"<i><span color='#a6da95'>{{playerName}}</span></i>: <b><span color='#f5a97f'>{{artist}}</span> - <span color='#c6a0f6'>{{markup_escape(title)}}</span></b>\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}" -F
end

View File

@@ -0,0 +1,8 @@
function fish_greeting
set_color blue; echo " Distro:  NixOS"
set_color white; echo " Langs:  Rust  Go  JS 󰛦 TS  Python  WasmEdge"
set_color green; echo " Shell: 󰈺 Fish"
set_color yellow; echo "󰟶 Mood: 👨‍💻"
set_color cyan; figlet random -f binary
# clear
end

View File

@@ -0,0 +1,10 @@
function fish_user_key_bindings
# Execute this once per mode that emacs bindings should be used in
fish_default_key_bindings -M insert
# Then execute the vi-bindings so they take precedence when there's a conflict.
# Without --no-erase fish_vi_key_bindings will default to
# resetting all bindings.
# The argument specifies the initial mode (insert, "default" or visual).
fish_vi_key_bindings --no-erase insert
end

View File

@@ -0,0 +1,9 @@
function night_mode_toggle
set target_process "gammastep"
if pgrep $target_process > /dev/null
killall -s SIGINT .gammastep-wrap
else
gammastep
end
end

View File

@@ -0,0 +1,16 @@
function record_screen_gif
set target_process "wf-recorder"
if pgrep $target_process > /dev/null
killall -s SIGINT $target_process
cb cp ~/Pictures/Records/(cd ~/Pictures/Records && ls -tA | head -n1 | awk '{print $NF}')
dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (GIF)" -t 2000
else
set geometry (slurp)
if not [ -z $geometry ]
set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S").gif")
dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Started  (GIF)" -t 2000
wf-recorder -g "$geometry" -f "$HOME/Pictures/Records/$record_name" -c gif -F fps=30
end
end
end

View File

@@ -0,0 +1,16 @@
function record_screen_mp4
set target_process "wf-recorder"
if pgrep $target_process > /dev/null
killall -s SIGINT $target_process
cb cp ~/Videos/Records/(cd ~/Videos/Records && ls -tA | head -n1 | awk '{print $NF}')
dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (MP4)" -t 2000
else
set geometry (slurp)
if not [ -z $geometry ]
set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S").mp4")
dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Started  (MP4)" -t 2000
wf-recorder -g "$geometry" -f "$HOME/Videos/Records/$record_name" -c h264_vaapi -d /dev/dri/renderD128
end
end
end

View File

@@ -0,0 +1,3 @@
function screenshot_edit
swappy -f ~/Pictures/Screenshots/(cd ~/Pictures/Screenshots && ls -tA | head -n1 | awk '{print $NF}')
end

View File

@@ -0,0 +1,9 @@
function screenshot_to_clipboard
set screenshot_filename (echo "$HOME/Pictures/Screenshots/screenshot-$(date +"%Y-%m-%d--%H:%M:%S").png")
grim -g (slurp) $screenshot_filename
if [ -e $screenshot_filename ]
cat $screenshot_filename | wl-copy --type image/png
dunstify -i $screenshot_filename -r (cd ~/Pictures/Screenshots/ && ls -1 | wc -l) "Screenshots" "Screenshot was taken" -t 2000
end
end

View File

@@ -0,0 +1,9 @@
function startup
wpaperd & \
waybar & \
poweralertd & \
wl-paste --watch cliphist store & \
avizo-service & \
systemctl --user start psi-notify &\
swayidle -w
end

View File

@@ -0,0 +1,3 @@
function tre
command tre $argv -e; and source /tmp/tre_aliases_$USER ^/dev/null
end

View File

@@ -0,0 +1,9 @@
function wifi_toggle
set wifi_status (nmcli radio wifi)
if [ "$wifi_status" = "enabled" ]
nmcli radio wifi off
else
nmcli radio wifi on
end
end

View File

@@ -0,0 +1,5 @@
function wlogout_uniqe
if [ -z $(pidof wlogout) ]
wlogout
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB