From b69a911cb1524ac695d53e518b2b86d27d7c53cc Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 16 Jul 2023 09:49:32 +0800 Subject: [PATCH 01/28] Update conf for fedora --- .config/kitty/kitty.conf | 2 +- .config/sway/config | 4 +-- .config/sway/config.d/custom | 2 +- .config/sway/config.d/custom.d/input-settings | 36 ------------------- .config/sway/config.d/custom.d/output | 8 ----- .config/sway/config.d/display | 6 +++- .config/sway/config.d/exec | 8 ++--- .config/sway/config.d/keybinds | 8 +++-- .config/sway/config.d/theme | 2 +- .config/sway/config.d/themes/dark | 3 +- .config/sway/config.d/themes/light | 3 +- .config/sway/scripts/grimshot-ui.sh | 16 ++++----- .config/sway/scripts/logout.sh | 2 +- .config/sway/scripts/themes.sh | 6 ++-- .config/sway/scripts/update-wallpaper.sh | 11 ++++-- .config/waybar/config | 16 ++++----- .config/waybar/style.css | 4 +-- .config/wofi/config | 6 ++-- 18 files changed, 56 insertions(+), 87 deletions(-) delete mode 100644 .config/sway/config.d/custom.d/input-settings delete mode 100644 .config/sway/config.d/custom.d/output diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index e0e0a40..3bc617b 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -6,7 +6,7 @@ bold_italic_font IBM Plex Mono SemiBold Italic font_size 13.5 -symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B Symbols-2048-em Nerd Font Complete +symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B Symbols Nerd Font Mono # shell stuff shell_integration enabled diff --git a/.config/sway/config b/.config/sway/config index 4d43956..d734f82 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,5 +1,5 @@ -include ~/.config/sway/config.d/exec +include ~/.config/sway/config.d/custom include ~/.config/sway/config.d/display +include ~/.config/sway/config.d/exec include ~/.config/sway/config.d/theme include ~/.config/sway/config.d/keybinds -include ~/.config/sway/config.d/custom diff --git a/.config/sway/config.d/custom b/.config/sway/config.d/custom index c6cb49b..6023060 100644 --- a/.config/sway/config.d/custom +++ b/.config/sway/config.d/custom @@ -1,3 +1,3 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig include ~/.config/sway/config.d/custom.d/* diff --git a/.config/sway/config.d/custom.d/input-settings b/.config/sway/config.d/custom.d/input-settings deleted file mode 100644 index a031fbb..0000000 --- a/.config/sway/config.d/custom.d/input-settings +++ /dev/null @@ -1,36 +0,0 @@ -# vim: filetype=i3config - -# swap caps and ctrl on Thinkpad keyboard -input 1:1:AT_Translated_Set_2_keyboard { - xkb_options "ctrl:swapcaps" -} - -# dugod keyboard and 2.4G variant -input 12136:130:Hoksi_Technology_DURGOD_Taurus_K320 { - # swap caps with ctrl, and lalt with lwin - xkb_options "ctrl:swapcaps, altwin:swap_lalt_lwin" -} - -input 12136:32832:Hoksi_Technology_DURGOD_Infinite_Link { - xkb_options "ctrl:swapcaps, altwin:swap_lalt_lwin" -} - -input type:mouse { - accel_profile flat -} - -# always disable touchpad -input type:touchpad { - events disabled -# accel_profile adaptive -# pointer_accel -0.3 -# natural_scroll enabled -# tap enabled -# dwt enabled -# events disabled_on_external_mouse -} - -input 2:14:ETPS/2_Elantech_TrackPoint { - accel_profile adaptive - pointer_accel 0 -} diff --git a/.config/sway/config.d/custom.d/output b/.config/sway/config.d/custom.d/output deleted file mode 100644 index 92417a2..0000000 --- a/.config/sway/config.d/custom.d/output +++ /dev/null @@ -1,8 +0,0 @@ -output DP-2 mode 2560x1440@74.968Hz -output DP-2 subpixel rgb -output * adaptive_sync on -output eDP-1 subpixel rgb - -# TV at home -output 'Unknown HUAWEI INC 0x00000000' mode 3840x2160@60.000Hz -output 'Unknown HUAWEI INC 0x00000000' scale 2 diff --git a/.config/sway/config.d/display b/.config/sway/config.d/display index aade454..161970d 100644 --- a/.config/sway/config.d/display +++ b/.config/sway/config.d/display @@ -1,4 +1,4 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig # laptop output mode set $laptop eDP-1 @@ -11,3 +11,7 @@ bar swaybar_command waybar #workspace_auto_back_and_forth yes force_display_urgency_hint 500 ms smart_borders no_gaps + +# Use static wallpaper + +output * bg $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) fill diff --git a/.config/sway/config.d/exec b/.config/sway/config.d/exec index 1f5f9a7..4425f93 100644 --- a/.config/sway/config.d/exec +++ b/.config/sway/config.d/exec @@ -1,11 +1,11 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig ##starting userspace software -exec_always sh -c ~/.config/sway/scripts/update-wallpaper.sh +# exec_always sh -c ~/.config/sway/scripts/update-wallpaper.sh exec mkfifo /tmp/kitty exec wlsunset -l 30.4 -L 104.0 -T 6500 -t 3500 exec light -S 70 -exec gentoo-pipewire-launcher +# exec gentoo-pipewire-launcher exec swaync exec playerctld daemon -exec dbus-update-activation-environment --all +# exec dbus-update-activation-environment --all diff --git a/.config/sway/config.d/keybinds b/.config/sway/config.d/keybinds index 25a9100..d0f94ab 100644 --- a/.config/sway/config.d/keybinds +++ b/.config/sway/config.d/keybinds @@ -1,4 +1,4 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig set $mod Mod4 set $left h @@ -12,7 +12,7 @@ set $menu wofi | xargs swaymsg exec -- # screenshot bindsym $mod+Print exec ~/.config/sway/scripts/grimshot-ui.sh -bindsym $mod+Ctrl+s exec ~/.config/sway/scripts/grimshot-ui.sh +bindsym $mod+Shift+s exec ~/.config/sway/scripts/grimshot-ui.sh # notification client bindsym $mod+m exec swaync-client -t -sw # Logout @@ -41,6 +41,8 @@ bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pa bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/scripts/getmute.sh > $SWAYSOCK.wob bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob +bindsym XF86KbdBrightnessUp exec light -s sysfs/leds/asus::kbd_backlight -S 67 +bindsym XF86KbdBrightnessDown exec light -s sysfs/leds/asus::kbd_backlight -S 0 bindsym XF86AudioPause exec 'playerctl pause' bindsym XF86AudioPlay exec 'playerctl play' @@ -49,7 +51,7 @@ bindsym XF86AudioNext exec 'playerctl next' bindsym XF86AudioPrev exec 'playerctl previous' # sticky window -bindsym $mod+Shift+s floating toggle ; sticky toggle ; resize set 800 600 ; move position 55ppt 5ppt +bindsym $mod+Ctrl+s floating toggle ; sticky toggle ; resize set 800 600 ; move position 55ppt 5ppt # Start a terminal bindsym $mod+Return exec $term diff --git a/.config/sway/config.d/theme b/.config/sway/config.d/theme index 4dc4ecf..eb8f44c 100644 --- a/.config/sway/config.d/theme +++ b/.config/sway/config.d/theme @@ -1,3 +1,3 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig include ~/.config/sway/config.d/themes/dark diff --git a/.config/sway/config.d/themes/dark b/.config/sway/config.d/themes/dark index fcae0d5..07c5e38 100644 --- a/.config/sway/config.d/themes/dark +++ b/.config/sway/config.d/themes/dark @@ -1,8 +1,9 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig #set gtk theme and font set $gnome-schema org.gnome.desktop.interface exec_always { + gsettings set $gnome-schema color-scheme 'prefer-dark' gsettings set $gnome-schema gtk-theme 'Adwaita-dark' gsettings set $gnome-schema icon-theme 'Papirus-Dark' gsettings set $gnome-schema cursor-theme 'Adwaita' diff --git a/.config/sway/config.d/themes/light b/.config/sway/config.d/themes/light index 1094bda..ecf8a6e 100644 --- a/.config/sway/config.d/themes/light +++ b/.config/sway/config.d/themes/light @@ -1,8 +1,9 @@ -# vim: filetype=i3config +# vim: filetype=swayconfig #set gtk theme and font set $gnome-schema org.gnome.desktop.interface exec_always { + gsettings set $gnome-schema color-scheme 'prefer-light' gsettings set $gnome-schema gtk-theme 'Adwaita' gsettings set $gnome-schema icon-theme 'Papirus-Light' gsettings set $gnome-schema cursor-theme 'Adwaita' diff --git a/.config/sway/scripts/grimshot-ui.sh b/.config/sway/scripts/grimshot-ui.sh index 7160d0e..33b2b3d 100755 --- a/.config/sway/scripts/grimshot-ui.sh +++ b/.config/sway/scripts/grimshot-ui.sh @@ -1,22 +1,22 @@ #!/bin/sh SCRIPT_LOC=~/.config/sway/scripts/ -FILE="/tmp/share/screenshots/`date +'%y%m%d%H%M.png'`" +FOLDER=~/Pictures/Screenshots/ +# FILE="/tmp/share/screenshots/`date +'%y%m%d%H%M.png'`" +FILE="$FOLDER`date +'%y%m%d%H%M.png'`" -action=`echo "copy\nsave" | wofi -d -Oalphabetical --prompt="Select your action"` -target=`echo "active\nscreen\noutput\narea\nwindow" | wofi -d -Oalphabetical --prompt="Select the target"` +action=`echo -e "copy\nsave" | wofi -d -Oalphabetical --prompt="Select your action"` +target=`echo -e "active\nscreen\noutput\narea\nwindow" | wofi -d -Oalphabetical --prompt="Select the target"` test $action || exit test $target || exit -test -d /tmp/share/screenshot || mkdir -p /tmp/share/screenshots +# test -d /tmp/share/screenshot || mkdir -p /tmp/share/screenshots -# TODO, add box shadows - -XDG_SCREENSHOTS_DIR=/tmp/share/screenshots ~/.config/sway/scripts/grimshot.sh --notify $action $target $FILE +~/.config/sway/scripts/grimshot.sh --notify $action $target $FILE if [ $target = "active" ] || [ $target = "window" ] || [ $target = "area" ] then $SCRIPT_LOC/boxshadow.sh "$FILE" "$FILE" || die "Unable to save screenshot" - echo "saved file" + echo -e "saved file" fi diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index 5bed593..f5ff9f2 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -1,6 +1,6 @@ #!/bin/sh -choice=`echo "suspend\nshutdown\npoweroff\nreboot\nlock\nhibernate" | wofi -d -Oalphabetical` +choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock\nhibernate" | wofi -d -Oalphabetical` if test "$choice" = lock ; then bright=`light` swayidle -w \ diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index c66b5f0..d15b2d9 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -1,4 +1,4 @@ -scheme=$(echo "light\ndark" | wofi -d -p "Select color scheme") +scheme=$(echo -e "light\ndark" | wofi -d -p "Select color scheme") # simply subsitude dark and light if [ $scheme = "light" ]; then @@ -26,14 +26,14 @@ if [ $scheme = "light" ]; then # set wallpaper location unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/Wallpapers/light ~/.config/sway/Wallpaper + ln -s ~/Pictures/wall/sway/light ~/.config/sway/Wallpaper else kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/dark.conf" & mv ~/.config/zathura/zathurarc.dark ~/.config/zathura/zathurarc # set dark wallpaper unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/Wallpapers/dark ~/.config/sway/Wallpaper + ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper fi sway reload diff --git a/.config/sway/scripts/update-wallpaper.sh b/.config/sway/scripts/update-wallpaper.sh index 4b8f501..8663669 100755 --- a/.config/sway/scripts/update-wallpaper.sh +++ b/.config/sway/scripts/update-wallpaper.sh @@ -4,10 +4,17 @@ export PATH="${PATH}:${HOME}/.local/bin" export XDG_RUNTIME_DIR=/run/user/1000 export XDG_CACHE_HOME=$HOME/.cache +# If not using sway, we exit +if ! pidof sway > /dev/null +then + exit +fi + +# If the deamon starts first time, we only init it, and the wallpaper will be updated if ! pidof swww-daemon > /dev/null then - swww init - exit + swww init + exit fi swww img $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) -t wave --transition-fps 60 --transition-duration 5 --transition-wave 16,16 diff --git a/.config/waybar/config b/.config/waybar/config index 7ca1988..42a52ac 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -28,15 +28,15 @@ "format-alt": " {usage}% @ {avg_frequency}GHz" }, "memory": { - "format": " {used:0.1f}G / {total:0.1f}G", - "format-alt": " Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" + "format": "󰍛 {used:0.1f}G / {total:0.1f}G", + "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" }, "network": { "format-wifi": " {essid} ({signalStrength}%)", - "format-ethernet": " {ifname}", + "format-ethernet": "󰈀 {ifname}", "format-linked": " {ifname}", - "format-disconnected": " Disconnected", - "format-alt": " {ifname}: {ipaddr}/{cidr}", + "format-disconnected": "󰌙 Disconnected", + "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", "tooltip-format": "{ifname} via {gwaddr}" }, "battery": { @@ -46,7 +46,7 @@ "critical": 5 }, "format": "{icon} {capacity}%", - "format-charging": " {capacity}%", + "format-charging": "🗲 {capacity}%", "format-plugged": " {capacity}%", "format-alt": "{icon} ETA: {time}", "format-icons": [ @@ -58,7 +58,7 @@ ] }, "clock": { - "format": "{: %H:%M\t %m-%d}", + "format": "{:󰅐 %H:%M\t %m-%d}", "tooltip-format": "{:%Y %B}\n{calendar}" }, "custom/notification": { @@ -78,7 +78,7 @@ "escape": true }, "custom/player": { - "format": " {}", + "format": "󰎈 {}", "return-type": "json", "exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", "max-length": 35, diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 5fb4dbc..b171b06 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -5,8 +5,8 @@ * { border: none; border-radius: 1px; - font-family: "IBM Plex Sans", sans-serif; - font-size: 13px; + font-family: "IBM Plex Sans", "Symbols Nerd Font" ,sans-serif; + font-size: 14px; min-height: 0; } diff --git a/.config/wofi/config b/.config/wofi/config index d4518d4..4c9ebea 100644 --- a/.config/wofi/config +++ b/.config/wofi/config @@ -1,13 +1,11 @@ # style -style=/home/juan/.config/wofi/dark.css +style=/home/ryan/.config/wofi/dark.css width=600 height=500 # opts show=drun -always_parse_args=true -show_all=true -print_command=true +fork=true layer=overlay insensitive=true location=center From 49314103c806eb43ec4957c3933dfbf0096b8dcb Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 16 Jul 2023 15:37:50 +0800 Subject: [PATCH 02/28] Enhance Dark / Light mode switching --- .config/gtk-2.0/dark.conf | 2 ++ .config/gtk-2.0/light.conf | 2 ++ .config/kitty/themes/light.conf | 1 - .config/qt5ct/dark.conf | 28 ++++++++++++++++++++ .config/qt5ct/light.conf | 28 ++++++++++++++++++++ .config/qt6ct/dark.conf | 32 +++++++++++++++++++++++ .config/qt6ct/light.conf | 32 +++++++++++++++++++++++ .config/sway/config.d/keybinds | 4 +-- .config/sway/scripts/logout.sh | 4 +-- .config/sway/scripts/themes.sh | 46 +++++++++++++++++++++------------ .config/swaync/config.json | 10 ++----- .config/swaync/style.css | 22 ++++++++-------- 12 files changed, 170 insertions(+), 41 deletions(-) create mode 100644 .config/gtk-2.0/dark.conf create mode 100644 .config/gtk-2.0/light.conf create mode 100644 .config/qt5ct/dark.conf create mode 100644 .config/qt5ct/light.conf create mode 100644 .config/qt6ct/dark.conf create mode 100644 .config/qt6ct/light.conf diff --git a/.config/gtk-2.0/dark.conf b/.config/gtk-2.0/dark.conf new file mode 100644 index 0000000..9886218 --- /dev/null +++ b/.config/gtk-2.0/dark.conf @@ -0,0 +1,2 @@ +gtk-icon-theme-name = "Papirus-Dark" +gtk-theme-name = "Adwaita-dark" diff --git a/.config/gtk-2.0/light.conf b/.config/gtk-2.0/light.conf new file mode 100644 index 0000000..42a2ace --- /dev/null +++ b/.config/gtk-2.0/light.conf @@ -0,0 +1,2 @@ +gtk-icon-theme-name = "Papirus-Light" +gtk-theme-name = "Adwaita" diff --git a/.config/kitty/themes/light.conf b/.config/kitty/themes/light.conf index dfd3a32..50d546a 100644 --- a/.config/kitty/themes/light.conf +++ b/.config/kitty/themes/light.conf @@ -1,4 +1,3 @@ -# vim:ft=kitty ## name: Gruvbox Material Light Medium ## author: Sainnhe Park ## license: MIT diff --git a/.config/qt5ct/dark.conf b/.config/qt5ct/dark.conf new file mode 100644 index 0000000..a379cb6 --- /dev/null +++ b/.config/qt5ct/dark.conf @@ -0,0 +1,28 @@ +[Appearance] +color_scheme_path=/usr/share/qt5ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus-Dark +standard_dialogs=gtk3 +style=Adwaita-Dark + +[Fonts] +fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=2 +cursor_flash_time=1000 +dialog_buttons_have_icons=2 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 \0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 \0\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 ) diff --git a/.config/qt5ct/light.conf b/.config/qt5ct/light.conf new file mode 100644 index 0000000..d7c18a8 --- /dev/null +++ b/.config/qt5ct/light.conf @@ -0,0 +1,28 @@ +[Appearance] +color_scheme_path=/usr/share/qt5ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus +standard_dialogs=gtk3 +style=Adwaita + +[Fonts] +fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=2 +cursor_flash_time=1000 +dialog_buttons_have_icons=2 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\"\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\"\0\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\") diff --git a/.config/qt6ct/dark.conf b/.config/qt6ct/dark.conf new file mode 100644 index 0000000..b6e1593 --- /dev/null +++ b/.config/qt6ct/dark.conf @@ -0,0 +1,32 @@ +[Appearance] +color_scheme_path=/usr/share/qt6ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus-Dark +standard_dialogs=gtk3 +style=Adwaita-Dark + +[Fonts] +fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=2 +cursor_flash_time=1000 +dialog_buttons_have_icons=2 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 \0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 \0\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\x4\xfd\0\0\x6 ) + +[Troubleshooting] +force_raster_widgets=1 +ignored_applications=@Invalid() diff --git a/.config/qt6ct/light.conf b/.config/qt6ct/light.conf new file mode 100644 index 0000000..0e33c58 --- /dev/null +++ b/.config/qt6ct/light.conf @@ -0,0 +1,32 @@ +[Appearance] +color_scheme_path=/usr/share/qt6ct/colors/airy.conf +custom_palette=false +icon_theme=Papirus +standard_dialogs=gtk3 +style=Adwaita + +[Fonts] +fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=2 +cursor_flash_time=1000 +dialog_buttons_have_icons=2 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\"\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\"\0\0\0\0\0\0\0\0\n\0\0\0\0\0\0\0\0\0\0\0\t\xff\0\0\x6\") + +[Troubleshooting] +force_raster_widgets=1 +ignored_applications=@Invalid() diff --git a/.config/sway/config.d/keybinds b/.config/sway/config.d/keybinds index d0f94ab..02daade 100644 --- a/.config/sway/config.d/keybinds +++ b/.config/sway/config.d/keybinds @@ -36,8 +36,8 @@ bindsym --whole-window $mod+button9 workspace next # bind fn keys bindsym XF86AudioMicMute exec amixer set Capture toggle exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob -bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +3% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -3% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/scripts/getmute.sh > $SWAYSOCK.wob bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index f5ff9f2..46525b8 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -5,12 +5,12 @@ if test "$choice" = lock ; then bright=`light` swayidle -w \ timeout 5 "light -S 1" resume "light -S $bright" \ - timeout 10 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ & idlepid=$! swaylock -e -c 282828 --inside-color 00000003 kill $idlepid - swaymsg "output * dpms on" + swaymsg "output * power on" light -S $bright return 0 fi diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index d15b2d9..f291906 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -2,13 +2,13 @@ scheme=$(echo -e "light\ndark" | wofi -d -p "Select color scheme") # simply subsitude dark and light if [ $scheme = "light" ]; then - notify-send "Toggling light color scheme" - command="s/dark/light/" + notify-send "Toggling light color scheme" + command="s/dark/light/" elif [ $scheme = "dark" ]; then - notify-send "Toggling dark color scheme" - command="s/light/dark/" + notify-send "Toggling dark color scheme" + command="s/light/dark/" else - exit 1 + exit 1 fi sed -i $command ~/.config/kitty/kitty.conf @@ -21,19 +21,31 @@ swaync-client -rs & # more settings if [ $scheme = "light" ]; then - kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/light.conf" & - mv ~/.config/zathura/zathurarc.light ~/.config/zathura/zathurarc - - # set wallpaper location - unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/wall/sway/light ~/.config/sway/Wallpaper + # kitty config + kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/light.conf" & + # zathura + mv ~/.config/zathura/zathurarc.light ~/.config/zathura/zathurarc + # qt5ct and qt6ct + cp ~/.config/qt5ct/light.conf ~/.config/qt5ct/qt5ct.conf + cp ~/.config/qt6ct/light.conf ~/.config/qt6ct/qt6ct.conf + # gtk2 + cp ~/.config/gtk-2.0/light.conf ~/.gtkrc-2.0 + # set wallpaper location + unlink ~/.config/sway/Wallpaper + ln -s ~/Pictures/wall/sway/light ~/.config/sway/Wallpaper else - kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/dark.conf" & - mv ~/.config/zathura/zathurarc.dark ~/.config/zathura/zathurarc - - # set dark wallpaper - unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper + # kitty config + kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/dark.conf" & + # zathura + mv ~/.config/zathura/zathurarc.dark ~/.config/zathura/zathurarc + # qt5ct and qt6ct + cp ~/.config/qt5ct/dark.conf ~/.config/qt5ct/qt5ct.conf + cp ~/.config/qt6ct/dark.conf ~/.config/qt6ct/qt6ct.conf + # gtk2 + cp ~/.config/gtk-2.0/dark.conf ~/.gtkrc-2.0 + # set dark wallpaper + unlink ~/.config/sway/Wallpaper + ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper fi sway reload diff --git a/.config/swaync/config.json b/.config/swaync/config.json index 6a41685..bbe25ac 100644 --- a/.config/swaync/config.json +++ b/.config/swaync/config.json @@ -11,15 +11,9 @@ "timeout-critical": 0, "notification-window-width": 512, "keyboard-shortcuts": true, - "image-visibility": "always", - "transition-time": 200, + "image-visibility": "when-available", "hide-on-clear": true, "hide-on-action": true, "script-fail-notify": true, - "scripts": { - "example-script": { - "exec": "echo 'Do something...'", - "urgency": "Normal" - } - } + "widgets": ["title", "dnd", "mpris"] } diff --git a/.config/swaync/style.css b/.config/swaync/style.css index e1eef77..7e08ad3 100644 --- a/.config/swaync/style.css +++ b/.config/swaync/style.css @@ -4,9 +4,14 @@ @import "dark.less"; +* { + color: @fg; + text-shadow: none; +} + .notification-row { outline: none; - background: transparent; + background: transparent; } .notification-row:focus, .notification-row:hover { @@ -16,7 +21,7 @@ .notification { border-radius: 2px; margin: 6px 12px; - box-shadow: 0px 2px 4px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.3); padding: 0; } @@ -100,11 +105,6 @@ text-shadow: none; } -.top-action-title { - color: @fg; - text-shadow: none; -} - .control-center-clear-all { color: @warning; text-shadow: none; @@ -135,13 +135,13 @@ .control-center { background: @bg-trans; - border-radius: 5px; - border: 1px solid @border-color; + border-radius: 5px; + border: 1px solid @border-color; } .control-center-list { background: @bg-trans; - border: 1px @border-color; - border-style: dashed solid hidden solid; + border: 1px @border-color; + border-style: dashed solid hidden solid; } .floating-notifications { From d472984aa04d0db0c29f7f6b42cde565be1310e1 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 16 Jul 2023 16:15:24 +0800 Subject: [PATCH 03/28] Theming update --- .config/sway/config.d/exec | 2 +- .config/sway/scripts/logout.sh | 2 +- .config/sway/scripts/themes.sh | 2 +- .config/waybar/style.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/sway/config.d/exec b/.config/sway/config.d/exec index 4425f93..0bb42fb 100644 --- a/.config/sway/config.d/exec +++ b/.config/sway/config.d/exec @@ -3,7 +3,7 @@ ##starting userspace software # exec_always sh -c ~/.config/sway/scripts/update-wallpaper.sh exec mkfifo /tmp/kitty -exec wlsunset -l 30.4 -L 104.0 -T 6500 -t 3500 +exec wlsunset -s 19:00 -S 07:00 exec light -S 70 # exec gentoo-pipewire-launcher exec swaync diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index 46525b8..b8daec3 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -1,6 +1,6 @@ #!/bin/sh -choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock\nhibernate" | wofi -d -Oalphabetical` +choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` if test "$choice" = lock ; then bright=`light` swayidle -w \ diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index f291906..bb3bc42 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -1,4 +1,4 @@ -scheme=$(echo -e "light\ndark" | wofi -d -p "Select color scheme") +scheme=$(echo -e "light\ndark" | wofi -d -p "󰔎 Select color scheme") # simply subsitude dark and light if [ $scheme = "light" ]; then diff --git a/.config/waybar/style.css b/.config/waybar/style.css index b171b06..e3d1c8c 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -45,7 +45,7 @@ window#waybar { } #clock { - color: @magenta; + color: @cyan; } #battery { From de0f05b9a0ac9e5dc635522282ec5c931db3b669 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 16 Jul 2023 20:53:46 +0800 Subject: [PATCH 04/28] Add wallpaper, and gtk2 font setting --- .config/gtk-2.0/dark.conf | 1 + .config/gtk-2.0/light.conf | 1 + .config/sway/scripts/themes.sh | 2 -- Pictures/wall/sway/dark/181818.png | Bin 0 -> 29880 bytes Pictures/wall/sway/light/fbf1c7.png | Bin 0 -> 29882 bytes 5 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Pictures/wall/sway/dark/181818.png create mode 100644 Pictures/wall/sway/light/fbf1c7.png diff --git a/.config/gtk-2.0/dark.conf b/.config/gtk-2.0/dark.conf index 9886218..cbd25fc 100644 --- a/.config/gtk-2.0/dark.conf +++ b/.config/gtk-2.0/dark.conf @@ -1,2 +1,3 @@ gtk-icon-theme-name = "Papirus-Dark" gtk-theme-name = "Adwaita-dark" +gtk-font-name = "IBM Plex 12" diff --git a/.config/gtk-2.0/light.conf b/.config/gtk-2.0/light.conf index 42a2ace..fcd2438 100644 --- a/.config/gtk-2.0/light.conf +++ b/.config/gtk-2.0/light.conf @@ -1,2 +1,3 @@ gtk-icon-theme-name = "Papirus-Light" gtk-theme-name = "Adwaita" +gtk-font-name = "IBM Plex 12" diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index bb3bc42..bd3b292 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -2,10 +2,8 @@ scheme=$(echo -e "light\ndark" | wofi -d -p "󰔎 Select color scheme") # simply subsitude dark and light if [ $scheme = "light" ]; then - notify-send "Toggling light color scheme" command="s/dark/light/" elif [ $scheme = "dark" ]; then - notify-send "Toggling dark color scheme" command="s/light/dark/" else exit 1 diff --git a/Pictures/wall/sway/dark/181818.png b/Pictures/wall/sway/dark/181818.png new file mode 100644 index 0000000000000000000000000000000000000000..a5e8528acfe321adcd9a3880f39c3404b56a1915 GIT binary patch literal 29880 zcmeI5eNfYN9LGO<&`kz37XsSQkxZ~$BIg-J>2O0>7r1Hz?4aaH1%>f2H_E3?VG&2D z*@e~csk-b8Ty@zUO2xs#>?p1WDUNwYrS@Q*#>wo$wO#%m{_5r1w@Hi(JsQJ$;`m!Rvjb zT9fL3JAZR^&DpPe%yRJxZ9$)tt5e14W-?6741{ulSZ`MG-EjQZB&Tm1f~W4>E+?&1w)_d}nRI#wsNruaNf_cpCx zrfL6Uc}>$Sb)(;1KXOQ>SW#POyZ&5VPmy!ItHoMzAXUF8dN{wTBzLK4bm6GyNW}|_ zOAB&SEj78Hn$Mm}+)x_ z=eue|N~N%5+L+N}4EP(^%*TzL3ch#Qu$mjJ2zm^%*S!?QuWVeUz0(#jU8+=h> zHDqTLQ+18AFtIkqcSyp8wU2R#BwX9TSFSl+`Wg4=LdCtffA{80* z>8ASOUx(8pf`h(ft@nCfbE~?eq1*m`T<}e9-W)p<1jzQEgFe znOXxJCa-YJJZaO0_AII{1%9!KyL9|rXy3^Bo690F#oKBJH4qzY{vwcq;J(Qz_(AZ`GYX(aqei1fGc=$o zA(_LZu`~b&-~b$e1FHaV_x|nI5>@(VpexS#o17JRnV5GB+FBj|C^bw$4K_{) zu>n$e=PV*QAUPm8unGVN;J^k0Y9(+04#0s`05|{#HW*MHfCF&&?>Jaaxig6r+e5z* zK$9CnM+?(bp;ip}SYUIS&==2q7<8bc105ac3=QZ&pS%uqoZpBeD_IV4gbr{34#0s? t05%mi6*iTj0X7vj6({VmGysQx!$ELCH#5l~a+yMU88UM8oh#Sw{2M|H3+(^^ literal 0 HcmV?d00001 diff --git a/Pictures/wall/sway/light/fbf1c7.png b/Pictures/wall/sway/light/fbf1c7.png new file mode 100644 index 0000000000000000000000000000000000000000..bc7e43c567b0856e9ec4002cfa7f2f7a798a0f31 GIT binary patch literal 29882 zcmeI5e^8Tk9LK-=k(&%?O$4-|BR0{J1kN*RrNa$jUErz>M+YhKLkF@SFd1dWhO#4% zNTUlXkg0XnnSgcLoo2uRVJ7AELyTh_k>#D&)k!3)3)Ut+KmPE)x(n{!yW4Hw=lk5V z-RJqd-tW)zz3=yVUe;x$hlMN+A%ui!Gc->Ta(CdX&?@8xK9-NDc)J7&PlTQ8UJvZQ0s@`jQv!qhPF?>|7 ze{@ChhsU2ATg;g}EQo76pah38aj6Sd@n@(kTZI1Mtbh?FAJTUx#BpPvtNY%LsOPkzU!i)S#3omLYA#;@Xpu^b{pO-98pZF$X;`y=Z`cGGhLPxmXQnO`nPs@5@ zx_-ZnCzWyw?z-^oRFz}PZj1kr>E;ygvoq!AJH^X;1E*!7H6y2j5YeLGn?v4ei4JTO z*tMByf@^|sQG7&>?5HZRX^B0}Xjfax%8JZ(qAoAWw-*)4947k?S-Lh;x5X76MTm@O zHL3cl;a`T6?jbU9cVc%}$58LZnubw@iSw3aN`!8ByOB#dbl;>Qq1f&>9)1PVf+jj$L(V4ehJ z0YO=SvVfp0Kv@vDl*1(xt~^l|5R?T3WkF!{YwiyxwdE;g!9g_fq<@!^>y6zhWDS*d zyV)aP=t4A@@lfOjNMQ|+LmVIu5C=K}zyUbW$w1(h@Je_k&BGmWkX^67NX-S9-SdvS zq3c!z;4knOnkV=RZ~zW-0*Ai#m;=E-BK*sLCdT!vjy(%)9iKJ1Y?~Tg%o#&8kQ=P| znji(@0CAur033h=oeTtC39p1#(mVhM-~b$e0~G-jODLA8Tp%cx<{u93E2nsp;2BKy zZ~Zv#QcQ3a@a(HImc3T(lFIGijM$b$#1ndvg8dz5_Y2b^K- z+n`+$dsw$pLl>e! Date: Mon, 17 Jul 2023 21:04:25 +0800 Subject: [PATCH 05/28] add zsh-completions --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index 6ebe31d..c1c7c18 100644 --- a/.zshrc +++ b/.zshrc @@ -30,6 +30,7 @@ zinit light sindresorhus/pure zinit light zsh-users/zsh-autosuggestions zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-history-substring-search +zinit light zsh-users/zsh-completions autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit From 6ce77d1cb49e8158936c2e043b766bd1be3f106f Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 10 Oct 2023 21:24:00 +0800 Subject: [PATCH 06/28] Update hyprland --- .config/hypr/hyprland.conf | 190 ++++++++++++++++++++++++++++ .config/hypr/hyprpaper.conf | 3 + .config/kanshi/config | 9 ++ .config/kitty/kitty.conf | 4 + .config/mpv/arguments.py | 87 +++++++++++++ .config/mpv/default-shader-pack | 1 + .config/mpv/mpv.conf | 20 ++- .config/sway/config | 4 +- .config/sway/config.d/display | 2 +- .config/sway/config.d/exec | 4 +- .config/sway/config.d/keybinds | 2 +- .config/sway/scripts/logout.sh | 24 ++-- .config/waybar/config | 13 +- .config/waybar/style.css | 2 +- .gitmodules | 3 + Pictures/wall/sway/dark/181818.png | Bin 29880 -> 0 bytes Pictures/wall/sway/light/fbf1c7.png | Bin 29882 -> 0 bytes 17 files changed, 343 insertions(+), 25 deletions(-) create mode 100644 .config/hypr/hyprland.conf create mode 100644 .config/hypr/hyprpaper.conf create mode 100644 .config/kanshi/config create mode 100644 .config/mpv/arguments.py create mode 160000 .config/mpv/default-shader-pack create mode 100644 .gitmodules delete mode 100644 Pictures/wall/sway/dark/181818.png delete mode 100644 Pictures/wall/sway/light/fbf1c7.png diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..1b61207 --- /dev/null +++ b/.config/hypr/hyprland.conf @@ -0,0 +1,190 @@ +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +exec=pkill kanshi; kanshi +exec=pidof hyprpaper || hyprpaper +exec=pidof wlsunset || wlsunset + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# env setting for nvidia +env = LIBVA_DRIVER_NAME,nvidia +env = XDG_SESSION_TYPE,wayland +# env = GBM_BACKEND,nvidia-drm +env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +env = WLR_NO_HARDWARE_CURSORS,1 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = true + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + gaps_in = 4 + gaps_out = 8 + border_size = 1 + col.active_border = rgb(fbf1c7) + col.inactive_border = rgb(928374) + cursor_inactive_timeout = 10 + resize_on_border = true + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 4 + + blur { + enabled = false + } + + drop_shadow = true +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this + force_split = 2 + no_gaps_when_only = 1 + default_split_ratio = 1.2 +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on +} + +misc { + disable_splash_rendering = true + vrr = 1 + disable_autoreload = true + focus_on_activate = true +} + +xwayland { + force_zero_scaling = true +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, N, exec, kitty +bind = $mainMod, W, killactive, +bind = $mainMod + CTRL, Q, exit, +bind = $mainMod + SHIFT, SPACE, togglefloating, +bind = $mainMod + SHIFT, RETURN, exec, wofi --show drun +bind = $mainMod + SHIFT, P, pseudo, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Move focus with hjkl also +bind = $mainMod, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d + +# Move windows with hjkl +bind = $mainMod + SHIFT, h, swapwindow, l +bind = $mainMod + SHIFT, l, swapwindow, r +bind = $mainMod + SHIFT, k, swapwindow, u +bind = $mainMod + SHIFT, j, swapwindow, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Resize windows +bind = $mainMod SHIFT, 60, resizeactive, -10% 0 +bind = $mainMod SHIFT, 59, resizeactive, 10% 0 +bind = $mainMod SHIFT, 21, resizeactive, 0 -10% +bind = $mainMod, 20, resizeactive, 0 10% + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# AutoExecs: +# Systemd +exec-once=/usr/libexec/sway-systemd/session.sh +exec-once=/usr/libexec/sway-systemd/assign-cgroups.py diff --git a/.config/hypr/hyprpaper.conf b/.config/hypr/hyprpaper.conf new file mode 100644 index 0000000..7ada119 --- /dev/null +++ b/.config/hypr/hyprpaper.conf @@ -0,0 +1,3 @@ +preload = ~/.config/sway/Wallpaper/bg.png +wallpaper = HDMI-A-1, ~/.config/sway/Wallpaper/bg.png +ipc = off diff --git a/.config/kanshi/config b/.config/kanshi/config new file mode 100644 index 0000000..9fa9764 --- /dev/null +++ b/.config/kanshi/config @@ -0,0 +1,9 @@ +profile docked { + output eDP-1 disable + output "XMI Redmi 27 NU 3948622WH08F4" mode 3840x2160@60Hz position 2560,0 transform 270 scale 1.5 + output "Lectron Company Ltd LECOO M2412HL GG30A137" mode 2560x1440@74.96800Hz position 0,0 +} + +profile mobile { + output eDP-1 enable +} diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 3bc617b..35373be 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -8,6 +8,10 @@ font_size 13.5 symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B Symbols Nerd Font Mono +# Performance + +sync_to_monitor yes + # shell stuff shell_integration enabled diff --git a/.config/mpv/arguments.py b/.config/mpv/arguments.py new file mode 100644 index 0000000..82678e5 --- /dev/null +++ b/.config/mpv/arguments.py @@ -0,0 +1,87 @@ +import argparse +import collections +import json +import pathlib + + +class Profile: + def __init__(self, object, json, groups_key="setting-groups"): + self.json = json + self.groups_key = groups_key + + self._settings = [] + self._shaders = [] + + self._collect(object) + + def _collect(self, object): + self._settings.extend(object.get("settings", [])) + self._shaders.extend(object.get("shaders", [])) + + for key in object.get(self.groups_key, []): + self._collect(self.json["setting-groups"][key]) + + +parser = argparse.ArgumentParser() + +parser.add_argument("--profile", default=None) +parser.add_argument( + "--path", default=f"{pathlib.Path.home()}/.config/mpv/default-shader-pack") +parser.add_argument("--config", default=False, action="store_true") + +arguments = parser.parse_args() +arguments.path = str(pathlib.Path(arguments.path)) + + +# with open(pathlib.Path(arguments.path, "pack.json"), "rb") as file: +with open(pathlib.Path(arguments.path, "pack-hq.json"), "rb") as file: + json_ = json.load(file) + + +if arguments.profile is None: + for profile in json_["profiles"].values(): + print(profile["displayname"]) + +else: + if arguments.config: + prefix = "" + end = None + + else: + prefix = "--" + end = " " + + default_profile = Profile( + json_, json_, groups_key="default-setting-groups") + + (_,) = ( + profile + for profile in json_["profiles"].values() + if profile["displayname"] == arguments.profile + ) + profile = Profile(_, json_) + for key, value in collections.OrderedDict( + default_profile._settings + profile._settings + ).items(): + key = key.replace("_", "-") + + if value is True: + print(prefix, key, sep="", end=end) + continue + + print(prefix, key, "=", value, sep="", end=end) + + print( + prefix, + "glsl-shaders=", + ":".join( + str(pathlib.Path(arguments.path, "shaders", shader)) + for shader in collections.OrderedDict( + (_, None) for _ in default_profile._shaders + profile._shaders + ).keys() + ), + sep="", + end=end, + ) + + print() diff --git a/.config/mpv/default-shader-pack b/.config/mpv/default-shader-pack new file mode 160000 index 0000000..ca506a6 --- /dev/null +++ b/.config/mpv/default-shader-pack @@ -0,0 +1 @@ +Subproject commit ca506a6bf3937881ebd1ab35bfbaf3d9b0221e0d diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index acd1e79..faa00c9 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -1,3 +1,19 @@ -volume=50 +volume=70 sub-auto=fuzzy -hwdec=auto-safe +# hwdec=auto-safe + +# mpv options with upscaling + +deband +deband-grain=0 +deband-range=12 +deband-threshold=32 +hwdec=auto-copy +profile=gpu-hq +gpu-api=opengl +fbo-format=rgba16f +dither-depth=auto +dither=fruit +glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/noise_static_luma.hook +glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/noise_static_chroma.hook +glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/CAS-scaled.glsl diff --git a/.config/sway/config b/.config/sway/config index d734f82..3e7034f 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,5 +1,5 @@ -include ~/.config/sway/config.d/custom include ~/.config/sway/config.d/display -include ~/.config/sway/config.d/exec include ~/.config/sway/config.d/theme include ~/.config/sway/config.d/keybinds +include ~/.config/sway/config.d/custom +include ~/.config/sway/config.d/exec diff --git a/.config/sway/config.d/display b/.config/sway/config.d/display index 161970d..b345821 100644 --- a/.config/sway/config.d/display +++ b/.config/sway/config.d/display @@ -6,7 +6,7 @@ bindswitch --reload --locked lid:on output $laptop disable bindswitch --reload --locked lid:off output $laptop enable # bar -bar swaybar_command waybar +# bar swaybar_command waybar #workspace_auto_back_and_forth yes force_display_urgency_hint 500 ms diff --git a/.config/sway/config.d/exec b/.config/sway/config.d/exec index 0bb42fb..daf3a43 100644 --- a/.config/sway/config.d/exec +++ b/.config/sway/config.d/exec @@ -3,9 +3,9 @@ ##starting userspace software # exec_always sh -c ~/.config/sway/scripts/update-wallpaper.sh exec mkfifo /tmp/kitty -exec wlsunset -s 19:00 -S 07:00 +exec wlsunset -s 19:00 -S 07:00 -d 1800 exec light -S 70 # exec gentoo-pipewire-launcher -exec swaync +# exec swaync exec playerctld daemon # exec dbus-update-activation-environment --all diff --git a/.config/sway/config.d/keybinds b/.config/sway/config.d/keybinds index 02daade..bec5f61 100644 --- a/.config/sway/config.d/keybinds +++ b/.config/sway/config.d/keybinds @@ -6,7 +6,7 @@ set $down j set $up k set $right l set $term kitty -1 -set $menu wofi | xargs swaymsg exec -- +set $menu wofi # my keybinds diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index b8daec3..e2fb54a 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -2,16 +2,16 @@ choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` if test "$choice" = lock ; then - bright=`light` - swayidle -w \ - timeout 5 "light -S 1" resume "light -S $bright" \ - timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ - & - idlepid=$! - swaylock -e -c 282828 --inside-color 00000003 - kill $idlepid - swaymsg "output * power on" - light -S $bright - return 0 + bright=`light` + swayidle -w \ + timeout 5 "light -S 1" resume "light -S $bright" \ + timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + & + idlepid=$! + swaylock -e -c 282828 --inside-color 00000003 + kill $idlepid + swaymsg "output * power on" + light -S $bright +else + loginctl $choice fi -loginctl $choice diff --git a/.config/waybar/config b/.config/waybar/config index 42a52ac..f74733b 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -1,11 +1,11 @@ { "layer": "top", "modules-left": [ - "sway/workspaces" + "hyprland/workspaces" ], "fixed-center": false, "modules-center": [ - "sway/window" + "hyprland/window" ], "modules-right": [ "tray", @@ -17,8 +17,13 @@ "battery", "clock" ], - "sway/window": { - "max-length": 50 + "hyprland/workspaces": { + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1" + }, + "hyprland/window": { + "max-length": 50, + "separate-outputs": true }, "tray": { "spacing": 10 diff --git a/.config/waybar/style.css b/.config/waybar/style.css index e3d1c8c..6bc15a8 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -27,7 +27,7 @@ window#waybar { color: @background_b; } -#workspaces button.focused { +#workspaces button.active { color: @foreground; font-weight: bold; } diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c868336 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".config/mpv/default-shader-pack"] + path = .config/mpv/default-shader-pack + url = https://github.com/iwalton3/default-shader-pack.git diff --git a/Pictures/wall/sway/dark/181818.png b/Pictures/wall/sway/dark/181818.png deleted file mode 100644 index a5e8528acfe321adcd9a3880f39c3404b56a1915..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29880 zcmeI5eNfYN9LGO<&`kz37XsSQkxZ~$BIg-J>2O0>7r1Hz?4aaH1%>f2H_E3?VG&2D z*@e~csk-b8Ty@zUO2xs#>?p1WDUNwYrS@Q*#>wo$wO#%m{_5r1w@Hi(JsQJ$;`m!Rvjb zT9fL3JAZR^&DpPe%yRJxZ9$)tt5e14W-?6741{ulSZ`MG-EjQZB&Tm1f~W4>E+?&1w)_d}nRI#wsNruaNf_cpCx zrfL6Uc}>$Sb)(;1KXOQ>SW#POyZ&5VPmy!ItHoMzAXUF8dN{wTBzLK4bm6GyNW}|_ zOAB&SEj78Hn$Mm}+)x_ z=eue|N~N%5+L+N}4EP(^%*TzL3ch#Qu$mjJ2zm^%*S!?QuWVeUz0(#jU8+=h> zHDqTLQ+18AFtIkqcSyp8wU2R#BwX9TSFSl+`Wg4=LdCtffA{80* z>8ASOUx(8pf`h(ft@nCfbE~?eq1*m`T<}e9-W)p<1jzQEgFe znOXxJCa-YJJZaO0_AII{1%9!KyL9|rXy3^Bo690F#oKBJH4qzY{vwcq;J(Qz_(AZ`GYX(aqei1fGc=$o zA(_LZu`~b&-~b$e1FHaV_x|nI5>@(VpexS#o17JRnV5GB+FBj|C^bw$4K_{) zu>n$e=PV*QAUPm8unGVN;J^k0Y9(+04#0s`05|{#HW*MHfCF&&?>Jaaxig6r+e5z* zK$9CnM+?(bp;ip}SYUIS&==2q7<8bc105ac3=QZ&pS%uqoZpBeD_IV4gbr{34#0s? t05%mi6*iTj0X7vj6({VmGysQx!$ELCH#5l~a+yMU88UM8oh#Sw{2M|H3+(^^ diff --git a/Pictures/wall/sway/light/fbf1c7.png b/Pictures/wall/sway/light/fbf1c7.png deleted file mode 100644 index bc7e43c567b0856e9ec4002cfa7f2f7a798a0f31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29882 zcmeI5e^8Tk9LK-=k(&%?O$4-|BR0{J1kN*RrNa$jUErz>M+YhKLkF@SFd1dWhO#4% zNTUlXkg0XnnSgcLoo2uRVJ7AELyTh_k>#D&)k!3)3)Ut+KmPE)x(n{!yW4Hw=lk5V z-RJqd-tW)zz3=yVUe;x$hlMN+A%ui!Gc->Ta(CdX&?@8xK9-NDc)J7&PlTQ8UJvZQ0s@`jQv!qhPF?>|7 ze{@ChhsU2ATg;g}EQo76pah38aj6Sd@n@(kTZI1Mtbh?FAJTUx#BpPvtNY%LsOPkzU!i)S#3omLYA#;@Xpu^b{pO-98pZF$X;`y=Z`cGGhLPxmXQnO`nPs@5@ zx_-ZnCzWyw?z-^oRFz}PZj1kr>E;ygvoq!AJH^X;1E*!7H6y2j5YeLGn?v4ei4JTO z*tMByf@^|sQG7&>?5HZRX^B0}Xjfax%8JZ(qAoAWw-*)4947k?S-Lh;x5X76MTm@O zHL3cl;a`T6?jbU9cVc%}$58LZnubw@iSw3aN`!8ByOB#dbl;>Qq1f&>9)1PVf+jj$L(V4ehJ z0YO=SvVfp0Kv@vDl*1(xt~^l|5R?T3WkF!{YwiyxwdE;g!9g_fq<@!^>y6zhWDS*d zyV)aP=t4A@@lfOjNMQ|+LmVIu5C=K}zyUbW$w1(h@Je_k&BGmWkX^67NX-S9-SdvS zq3c!z;4knOnkV=RZ~zW-0*Ai#m;=E-BK*sLCdT!vjy(%)9iKJ1Y?~Tg%o#&8kQ=P| znji(@0CAur033h=oeTtC39p1#(mVhM-~b$e0~G-jODLA8Tp%cx<{u93E2nsp;2BKy zZ~Zv#QcQ3a@a(HImc3T(lFIGijM$b$#1ndvg8dz5_Y2b^K- z+n`+$dsw$pLl>e! Date: Wed, 15 Nov 2023 11:25:03 +0800 Subject: [PATCH 07/28] Add config for hyprland --- .config/hypr/hyprland.conf | 193 +-------------------- .config/hypr/hyprland.conf.d/autoexec.conf | 17 ++ .config/hypr/hyprland.conf.d/input.conf | 28 +++ .config/hypr/hyprland.conf.d/keybind.conf | 91 ++++++++++ .config/hypr/hyprland.conf.d/output.conf | 11 ++ .config/hypr/hyprland.conf.d/ui.conf | 55 ++++++ .config/hypr/hyprpaper.conf | 3 +- .config/hypr/scripts/clamshell.sh | 6 + .config/kanshi/config | 9 - .config/waybar/config | 9 +- .config/waybar/style.css | 5 + README.md | 4 +- 12 files changed, 229 insertions(+), 202 deletions(-) create mode 100644 .config/hypr/hyprland.conf.d/autoexec.conf create mode 100644 .config/hypr/hyprland.conf.d/input.conf create mode 100644 .config/hypr/hyprland.conf.d/keybind.conf create mode 100644 .config/hypr/hyprland.conf.d/output.conf create mode 100644 .config/hypr/hyprland.conf.d/ui.conf create mode 100755 .config/hypr/scripts/clamshell.sh delete mode 100644 .config/kanshi/config diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 1b61207..f2df121 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -1,190 +1,7 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ for more -# Execute your favorite apps at launch -exec=pkill kanshi; kanshi -exec=pidof hyprpaper || hyprpaper -exec=pidof wlsunset || wlsunset - -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf - -# Some default env vars. -env = XCURSOR_SIZE,24 - -# env setting for nvidia -env = LIBVA_DRIVER_NAME,nvidia -env = XDG_SESSION_TYPE,wayland -# env = GBM_BACKEND,nvidia-drm -env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 -env = __GLX_VENDOR_LIBRARY_NAME,nvidia -env = WLR_NO_HARDWARE_CURSORS,1 - -# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ -input { - kb_layout = us - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = true - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. -} - -general { - gaps_in = 4 - gaps_out = 8 - border_size = 1 - col.active_border = rgb(fbf1c7) - col.inactive_border = rgb(928374) - cursor_inactive_timeout = 10 - resize_on_border = true - layout = dwindle -} - -decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 4 - - blur { - enabled = false - } - - drop_shadow = true -} - -animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = borderangle, 1, 8, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default -} - -dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this - force_split = 2 - no_gaps_when_only = 1 - default_split_ratio = 1.2 -} - -master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - new_is_master = true -} - -gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = on -} - -misc { - disable_splash_rendering = true - vrr = 1 - disable_autoreload = true - focus_on_activate = true -} - -xwayland { - force_zero_scaling = true -} - -# Example per-device config -# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more -device:epic-mouse-v1 { - sensitivity = -0.5 -} - -# Example windowrule v1 -# windowrule = float, ^(kitty)$ -# Example windowrule v2 -# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ -# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more -$mainMod = SUPER - -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, N, exec, kitty -bind = $mainMod, W, killactive, -bind = $mainMod + CTRL, Q, exit, -bind = $mainMod + SHIFT, SPACE, togglefloating, -bind = $mainMod + SHIFT, RETURN, exec, wofi --show drun -bind = $mainMod + SHIFT, P, pseudo, # dwindle - -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -# Move focus with hjkl also -bind = $mainMod, h, movefocus, l -bind = $mainMod, l, movefocus, r -bind = $mainMod, k, movefocus, u -bind = $mainMod, j, movefocus, d - -# Move windows with hjkl -bind = $mainMod + SHIFT, h, swapwindow, l -bind = $mainMod + SHIFT, l, swapwindow, r -bind = $mainMod + SHIFT, k, swapwindow, u -bind = $mainMod + SHIFT, j, swapwindow, d - -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 - -# Resize windows -bind = $mainMod SHIFT, 60, resizeactive, -10% 0 -bind = $mainMod SHIFT, 59, resizeactive, 10% 0 -bind = $mainMod SHIFT, 21, resizeactive, 0 -10% -bind = $mainMod, 20, resizeactive, 0 10% - -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -# AutoExecs: -# Systemd -exec-once=/usr/libexec/sway-systemd/session.sh -exec-once=/usr/libexec/sway-systemd/assign-cgroups.py +source=~/.config/hypr/hyprland.conf.d/ui.conf +source=~/.config/hypr/hyprland.conf.d/output.conf +source=~/.config/hypr/hyprland.conf.d/keybind.conf +source=~/.config/hypr/hyprland.conf.d/input.conf +source=~/.config/hypr/hyprland.conf.d/autoexec.conf diff --git a/.config/hypr/hyprland.conf.d/autoexec.conf b/.config/hypr/hyprland.conf.d/autoexec.conf new file mode 100644 index 0000000..35a173b --- /dev/null +++ b/.config/hypr/hyprland.conf.d/autoexec.conf @@ -0,0 +1,17 @@ +# env setting for nvidia +env = LIBVA_DRIVER_NAME,nvidia +env = XDG_SESSION_TYPE,wayland +# env = GBM_BACKEND,nvidia-drm +env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +env = WLR_NO_HARDWARE_CURSORS,1 + +# Execute your favorite apps at launch +exec=pidof hyprpaper || hyprpaper +exec=pidof wlsunset || wlsunset -S 08:00 -s 19:00 +exec=pidof waybar || waybar +exec=~/.config/hypr/scripts/clamshell.sh +exec-once=fcitx5 -d + +# ssh agent +env = SSH_AUTH_SOCK,"${XDG_RUNTIME_DIR}/ssh-agent.socket" diff --git a/.config/hypr/hyprland.conf.d/input.conf b/.config/hypr/hyprland.conf.d/input.conf new file mode 100644 index 0000000..6cc99af --- /dev/null +++ b/.config/hypr/hyprland.conf.d/input.conf @@ -0,0 +1,28 @@ +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = true + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf new file mode 100644 index 0000000..cc7c21a --- /dev/null +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -0,0 +1,91 @@ +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, N, exec, kitty +bind = $mainMod, W, killactive, +bind = $mainMod + CTRL, Q, exit, +bind = $mainMod + SHIFT, SPACE, togglefloating, +bind = $mainMod + SHIFT, RETURN, exec, wofi --show drun +bind = $mainMod + SHIFT, P, pseudo, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Move focus with hjkl also +bind = $mainMod, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d + +# Move windows with hjkl +bind = $mainMod + SHIFT, h, movewindow, l +bind = $mainMod + SHIFT, l, movewindow, r +bind = $mainMod + SHIFT, k, movewindow, u +bind = $mainMod + SHIFT, j, movewindow, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, togglespecialworkspace + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 +bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2 +bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3 +bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4 +bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5 +bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6 +bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7 +bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8 +bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9 +bind = $mainMod SHIFT, 0, movetoworkspacesilent, special + +# Resize windows +binde = $mainMod SHIFT, 60, resizeactive, -10% 0 +binde = $mainMod SHIFT, 59, resizeactive, 10% 0 +binde = $mainMod SHIFT, 21, resizeactive, 0 -10% +binde = $mainMod, 20, resizeactive, 0 10% + +# Fullscreen +bind= $mainMod, F, fullscreen, 0 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e-1 +bind = $mainMod, mouse_up, workspace, e+1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# reload hyprland +bind = $mainMod CTRL, r, exec, hyprctl reload + +# change IME +bind = $mainMod CTRL, 65, exec, fcitx5-remote -t + +# open swayNC +bind = $mainMod, M, exec, swaync-client -t + +# fn keys +bind=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+ +bindl=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- +bind=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind=, XF86AudioMicMute, exec , wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bind=, XF86MonBrightnessUp, exec, light -A 5 +bind=, XF86MonBrightnessDown, exec, light -U 5 +bind=, XF86AudioPause, exec, 'playerctl pause' +bind=, XF86AudioPlay, exec, 'playerctl play' +bind=, XF86AudioStop, exec, 'playerctl stop' +bind=, XF86AudioNext, exec, 'playerctl next' +bind=, XF86AudioPrev, exec, 'playerctl previous' diff --git a/.config/hypr/hyprland.conf.d/output.conf b/.config/hypr/hyprland.conf.d/output.conf new file mode 100644 index 0000000..dee4061 --- /dev/null +++ b/.config/hypr/hyprland.conf.d/output.conf @@ -0,0 +1,11 @@ +monitor=,highres,auto,auto +monitor=desc:Lectron Company Ltd LECOO M2412HL GG30A137,2560x1440@74.96800,0x500,auto,bitdepth,10 +monitor=desc:XMI Redmi 27 NU 3948622WH08F4,3840x2160@60.00000,2560x0,auto,transform,3,bitdepth,10 +monitor=eDP-1,2560x1600@60.00000,auto,auto,bitdepth,10 + +# Clamshell mode +## Lid is opened +bindl=,switch:off:Lid Switch,exec,~/.config/hypr/scripts/clamshell.sh + +## Lid is closed +bindl=,switch:on:Lid Switch,exec,~/.config/hypr/scripts/clamshell.sh diff --git a/.config/hypr/hyprland.conf.d/ui.conf b/.config/hypr/hyprland.conf.d/ui.conf new file mode 100644 index 0000000..545fdcb --- /dev/null +++ b/.config/hypr/hyprland.conf.d/ui.conf @@ -0,0 +1,55 @@ +general { + gaps_in = 4 + gaps_out = 8 + border_size = 1 + col.active_border = rgb(fbf1c7) + col.inactive_border = rgb(928374) + cursor_inactive_timeout = 10 + resize_on_border = true + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 4 + + blur { + enabled = false + } + + drop_shadow = false +} + +animations { + enabled = yes + animation=specialWorkspace,1,4,default,slidefadevert +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this + force_split = 2 + no_gaps_when_only = 1 + default_split_ratio = 1.2 +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = false + no_gaps_when_only = true + # drop_at_cursor = true +} + +misc { + disable_splash_rendering = true + disable_hyprland_logo = true + vrr = 1 + disable_autoreload = true + focus_on_activate = true +} + +xwayland { + force_zero_scaling = true +} diff --git a/.config/hypr/hyprpaper.conf b/.config/hypr/hyprpaper.conf index 7ada119..70ab1f1 100644 --- a/.config/hypr/hyprpaper.conf +++ b/.config/hypr/hyprpaper.conf @@ -1,3 +1,4 @@ preload = ~/.config/sway/Wallpaper/bg.png -wallpaper = HDMI-A-1, ~/.config/sway/Wallpaper/bg.png +wallpaper = , ~/.config/sway/Wallpaper/bg.png +# wallpaper = HDMI-A-1, ~/.config/sway/Wallpaper/bg.png ipc = off diff --git a/.config/hypr/scripts/clamshell.sh b/.config/hypr/scripts/clamshell.sh new file mode 100755 index 0000000..cb05944 --- /dev/null +++ b/.config/hypr/scripts/clamshell.sh @@ -0,0 +1,6 @@ +if hyprctl monitors | grep "Lectron Company Ltd LECOO M2412HL GG30A137" &>/dev/null +then + hyprctl keyword monitor "eDP-1, disable" +else + hyprctl keyword monitor "eDP-1, 2560x1440@90, auto, auto" +fi diff --git a/.config/kanshi/config b/.config/kanshi/config deleted file mode 100644 index 9fa9764..0000000 --- a/.config/kanshi/config +++ /dev/null @@ -1,9 +0,0 @@ -profile docked { - output eDP-1 disable - output "XMI Redmi 27 NU 3948622WH08F4" mode 3840x2160@60Hz position 2560,0 transform 270 scale 1.5 - output "Lectron Company Ltd LECOO M2412HL GG30A137" mode 2560x1440@74.96800Hz position 0,0 -} - -profile mobile { - output eDP-1 enable -} diff --git a/.config/waybar/config b/.config/waybar/config index f74733b..ff9b591 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -18,8 +18,13 @@ "clock" ], "hyprland/workspaces": { - "on-scroll-up": "hyprctl dispatch workspace e+1", - "on-scroll-down": "hyprctl dispatch workspace e-1" + "on-scroll-up": "hyprctl dispatch workspace e-1", + "on-scroll-down": "hyprctl dispatch workspace e+1", + "show_special": true, + "on-click": "activate", + "persistent_workspaces": { + "9": ["HDMI-A-1"] + } }, "hyprland/window": { "max-length": 50, diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 6bc15a8..df5fbc1 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -27,6 +27,11 @@ window#waybar { color: @background_b; } +#workspaces button.visible { + color: @foreground; + font-weight: bold; +} + #workspaces button.active { color: @foreground; font-weight: bold; diff --git a/README.md b/README.md index 6f72e13..74647f1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Linux desktop with gruvbox colorscheme, following the KISS philosophy. # Installing I use [yadm](https://github.com/TheLocehiliosan/yadm) to manage dotfiles, the directory layout is unchanged. + ```bash yadm clone https://github.com/JuanCldCmt/dotfiles ``` @@ -18,7 +19,7 @@ yadm clone https://github.com/JuanCldCmt/dotfiles | Name | Description | |------|-------------| -|swayWM|Tiling WM| +|hyprland|wayland WM with better nvidia support| |waybar|Custom bar for sway| |swayNC|Notification center| |wofi|App launcher| @@ -36,4 +37,3 @@ yadm clone https://github.com/JuanCldCmt/dotfiles |pipewire|Sound deamon| |wireplumber|media session management (remember to replace it in sway's config if using non-gentoo)| |playerctld|Control players| -|grim|Take screenshots| From c7b0e12a7a752ae0c066b3db9c679ddcb77635b7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 21 Nov 2023 10:06:26 +0800 Subject: [PATCH 08/28] add tmux back, and update zsh path --- .config/tmux/tmux.conf | 53 ++++++++++++++++++++++++++++++++++++++++++ .zshrc | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .config/tmux/tmux.conf diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..d697d56 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,53 @@ +set -g default-terminal "tmux-256color" +set-option -ga terminal-overrides ",screen-256color:Tc" + +## COLORSCHEME: gruvbox dark (medium) +set-option -g status "on" + +# default statusbar color +set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1 + +# default window title colors +set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1 + +# default window with an activity alert +set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3 + +# active window title colors +set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1 + +# pane border +set-option -g pane-active-border-style fg=colour250 #fg2 +set-option -g pane-border-style fg=colour237 #bg1 + +# message infos +set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1 + +# writing commands inactive +set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1 + +# pane number display +set-option -g display-panes-active-colour colour250 #fg2 +set-option -g display-panes-colour colour237 #bg1 + +# clock +set-window-option -g clock-mode-colour colour109 #blue + +# bell +set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg + +## Theme settings mixed with colors (unfortunately, but there is no cleaner way) +set-option -g status-justify "left" +set-option -g status-left-style none +set-option -g status-left-length "80" +set-option -g status-right-style none +set-option -g status-right-length "80" +set-window-option -g window-status-separator "" + +set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]" +set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d  %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h " + +set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]" +set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]" + +# vim: set ft=tmux tw=0: diff --git a/.zshrc b/.zshrc index c1c7c18..e5719be 100644 --- a/.zshrc +++ b/.zshrc @@ -119,7 +119,7 @@ export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB export LESS="-RSM~" #local path -export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin" +export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" export MANPATH="${MANPATH}:${HOME}/.local/share/man" #ccache support From 4906475570318a84c6e576ffea5dd907bae95c54 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 23 Nov 2023 12:18:23 +0800 Subject: [PATCH 09/28] Update prompt and other stuff --- .config/starship.toml | 5 +++++ .zshrc | 47 +++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 .config/starship.toml diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..77812a0 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,5 @@ +# Get editor completions based on the config schema +"$schema" = 'https://starship.rs/config-schema.json' + +# Inserts a blank line between shell prompts +add_newline = true diff --git a/.zshrc b/.zshrc index e5719be..fdf1487 100644 --- a/.zshrc +++ b/.zshrc @@ -3,30 +3,30 @@ echo echo '\033[0;35m /w '$(awk -F "=" '/^NAME/ {print $2}' 2> /dev/null < /etc/os-release || uname -o) echo '\033[0;34m @ '$HOST -#Install zinit if no zinit is present +# Install zinit if no zinit is present ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" if [[ ! -f $ZINIT_HOME/zinit.zsh ]]; then - print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f" - mkdir -p "$(dirname $ZINIT_HOME)" - git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" - print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ - print -P "%F{160}▓▒░ The clone has failed.%f%b" + print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f" + mkdir -p "$(dirname $ZINIT_HOME)" + git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" + print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ + print -P "%F{160}▓▒░ The clone has failed.%f%b" fi source "$ZINIT_HOME/zinit.zsh" -zinit ice lucid wait -zinit light zdharma-continuum/fast-syntax-highlighting -zinit ice lucid wait -zinit light agkozak/zsh-z -zinit ice lucid wait -zinit light juancldcmt/colorize -zinit ice lucid wait -zinit light juancldcmt/shortify.zsh -# zinit ice lucid wait -# zinit light juancldcmt/direnv.zsh +# Zinit packages + +zinit wait lucid for \ + zdharma-continuum/fast-syntax-highlighting \ + agkozak/zsh-z \ + zpm-zsh/colorize \ + juancldcmt/shortify.zsh + +zinit ice as"command" from"gh-r" \ + atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ + atpull"%atclone" src"init.zsh" +zinit light starship/starship -zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' -zinit light sindresorhus/pure zinit light zsh-users/zsh-autosuggestions zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-history-substring-search @@ -35,10 +35,6 @@ zinit light zsh-users/zsh-completions autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit -# Load LS_COLORS if not present -test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' - - # The following lines were added by compinstall zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f' @@ -76,9 +72,6 @@ unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install -# pure config -zstyle :prompt:pure:prompt:success color green - #edit in vim export KEYTIMEOUT=1 autoload edit-command-line @@ -112,11 +105,13 @@ export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt= export GPG_TTY=$(tty) # fixes gpg export JDK_HOME=/usr/lib/jvm/openjdk-17 export _JAVA_AWT_WM_NONREPARENTING=1 +export HISTORY_SUBSTRING_SEARCH_FUZZY=1 #colored output export MANWIDTH=${MANWIDTH:-78} +test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB\\%.." -export LESS="-RSM~" +export LESS="--use-color -RSM~" #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" From 15ee8a707052fe97fbdf9e5a8de2269785a04b50 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 2 Dec 2023 18:55:00 +0800 Subject: [PATCH 10/28] Update --- .config/hypr/hyprland.conf.d/autoexec.conf | 9 ++++--- .config/hypr/hyprland.conf.d/keybind.conf | 12 ++++++---- .config/hypr/hyprland.conf.d/ui.conf | 3 +-- .config/hypr/plugins/hy3 | 1 + .config/sway/Wallpaper | 1 + .config/sway/config | 2 ++ .config/sway/config.d/custom.d/fedora | 4 ++++ .config/sway/config.d/custom.d/input-settings | 14 +++++++++++ .config/sway/config.d/custom.d/outputs | 24 +++++++++++++++++++ .gitmodules | 3 +++ .zshrc | 3 ++- 11 files changed, 64 insertions(+), 12 deletions(-) create mode 160000 .config/hypr/plugins/hy3 create mode 120000 .config/sway/Wallpaper create mode 100644 .config/sway/config.d/custom.d/fedora create mode 100644 .config/sway/config.d/custom.d/input-settings create mode 100644 .config/sway/config.d/custom.d/outputs diff --git a/.config/hypr/hyprland.conf.d/autoexec.conf b/.config/hypr/hyprland.conf.d/autoexec.conf index 35a173b..61cf0f9 100644 --- a/.config/hypr/hyprland.conf.d/autoexec.conf +++ b/.config/hypr/hyprland.conf.d/autoexec.conf @@ -7,11 +7,10 @@ env = __GLX_VENDOR_LIBRARY_NAME,nvidia env = WLR_NO_HARDWARE_CURSORS,1 # Execute your favorite apps at launch -exec=pidof hyprpaper || hyprpaper -exec=pidof wlsunset || wlsunset -S 08:00 -s 19:00 -exec=pidof waybar || waybar +exec=pidof -q hyprpaper || hyprpaper +exec=pidof -q wlsunset || wlsunset -S 08:00 -s 19:00 +exec=pidof -q waybar || waybar exec=~/.config/hypr/scripts/clamshell.sh exec-once=fcitx5 -d -# ssh agent -env = SSH_AUTH_SOCK,"${XDG_RUNTIME_DIR}/ssh-agent.socket" +env = SSH_AUTH_SOCK,$XDG_RUNTIME_DIR/ssh-agent.socket diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf index cc7c21a..9c720fe 100644 --- a/.config/hypr/hyprland.conf.d/keybind.conf +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -22,10 +22,14 @@ bind = $mainMod, k, movefocus, u bind = $mainMod, j, movefocus, d # Move windows with hjkl -bind = $mainMod + SHIFT, h, movewindow, l -bind = $mainMod + SHIFT, l, movewindow, r -bind = $mainMod + SHIFT, k, movewindow, u -bind = $mainMod + SHIFT, j, movewindow, d +bind = $mainMod + SHIFT, h, swapwindow, l +bind = $mainMod + SHIFT, l, swapwindow, r +bind = $mainMod + SHIFT, k, swapwindow, u +bind = $mainMod + SHIFT, j, swapwindow, d + +# Grouping +bind = $mainMod, t, togglegroup +bind = $mainMod, TAB, changegroupactive # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 diff --git a/.config/hypr/hyprland.conf.d/ui.conf b/.config/hypr/hyprland.conf.d/ui.conf index 545fdcb..288f038 100644 --- a/.config/hypr/hyprland.conf.d/ui.conf +++ b/.config/hypr/hyprland.conf.d/ui.conf @@ -22,8 +22,7 @@ decoration { } animations { - enabled = yes - animation=specialWorkspace,1,4,default,slidefadevert + enabled = false } dwindle { diff --git a/.config/hypr/plugins/hy3 b/.config/hypr/plugins/hy3 new file mode 160000 index 0000000..4db9b1f --- /dev/null +++ b/.config/hypr/plugins/hy3 @@ -0,0 +1 @@ +Subproject commit 4db9b1f37a5f429aa5d103143176ba2f5dd20f16 diff --git a/.config/sway/Wallpaper b/.config/sway/Wallpaper new file mode 120000 index 0000000..4e640f7 --- /dev/null +++ b/.config/sway/Wallpaper @@ -0,0 +1 @@ +/home/ryan/Pictures/wall/sway/dark \ No newline at end of file diff --git a/.config/sway/config b/.config/sway/config index 3e7034f..a5d2b0a 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -3,3 +3,5 @@ include ~/.config/sway/config.d/theme include ~/.config/sway/config.d/keybinds include ~/.config/sway/config.d/custom include ~/.config/sway/config.d/exec + +exec kitty diff --git a/.config/sway/config.d/custom.d/fedora b/.config/sway/config.d/custom.d/fedora new file mode 100644 index 0000000..b7010c1 --- /dev/null +++ b/.config/sway/config.d/custom.d/fedora @@ -0,0 +1,4 @@ +# vim: filetype=swayconfig + +include /etc/sway/config.d/* +exec /usr/libexec/polkit-gnome-authentication-agent-1 diff --git a/.config/sway/config.d/custom.d/input-settings b/.config/sway/config.d/custom.d/input-settings new file mode 100644 index 0000000..550d369 --- /dev/null +++ b/.config/sway/config.d/custom.d/input-settings @@ -0,0 +1,14 @@ +# vim: filetype=swayconfig + +input type:mouse { + accel_profile flat + pointer_accel -0.3 +} + +input type:touchpad { + accel_profile adaptive + natural_scroll enabled + tap enabled + dwt enabled + # events disabled_on_external_mouse +} diff --git a/.config/sway/config.d/custom.d/outputs b/.config/sway/config.d/custom.d/outputs new file mode 100644 index 0000000..4438f66 --- /dev/null +++ b/.config/sway/config.d/custom.d/outputs @@ -0,0 +1,24 @@ +# 75hz monitor +output 'Lectron Company Ltd LECOO M2412HL GG30A137' mode 2560x1440@74.968Hz +output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb +# output 'Lectron Company Ltd LECOO M2412HL GG30A137' max_render_time 5 +# output 'Lectron Company Ltd LECOO M2412HL GG30A137' render_bit_depth 10 + +output * adaptive_sync on + +# laptop screen +output 'Thermotrex Corporation TL160ADMP03-0 Unknown' subpixel rgb +# output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@60.000Hz +# output 'Thermotrex Corporation TL160ADMP03-0 Unknown' max_render_time 5 +output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@240.000Hz +output 'Thermotrex Corporation TL160ADMP03-0 Unknown' max_render_time 8 +# output 'Thermotrex Corporation TL160ADMP03-0 Unknown' render_bit_depth 10 + +# TV at home +output 'Unknown HUAWEI INC 0x00000000' mode 3840x2160@60.000Hz +output 'Unknown HUAWEI INC 0x00000000' scale 2 + +# lab screen +output "XMI Redmi 27 NU 3948622WH08F4" transform 90 +# output "XMI Redmi 27 NU 3948622WH08F4" max_render_time 5 +# output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb diff --git a/.gitmodules b/.gitmodules index c868336..3b793f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule ".config/mpv/default-shader-pack"] path = .config/mpv/default-shader-pack url = https://github.com/iwalton3/default-shader-pack.git +[submodule ".config/hypr/plugins/hy3"] + path = .config/hypr/plugins/hy3 + url = https://github.com/outfoxxed/hy3.git diff --git a/.zshrc b/.zshrc index fdf1487..139de06 100644 --- a/.zshrc +++ b/.zshrc @@ -109,8 +109,9 @@ export HISTORY_SUBSTRING_SEARCH_FUZZY=1 #colored output export MANWIDTH=${MANWIDTH:-78} +test -e /bin/nvim && export MANPAGER='nvim +Man!' || \ + export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB\\%.." test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' -export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB\\%.." export LESS="--use-color -RSM~" #local path From 8447ed667d0d2dbf9ef94058149ee8d887e9dc52 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Dec 2023 10:29:58 +0800 Subject: [PATCH 11/28] Add nvidia backend --- .config/hypr/hyprland.conf.d/autoexec.conf | 2 +- .config/hypr/hyprland.conf.d/keybind.conf | 4 - .config/hypr/plugins/hy3 | 1 - .config/waybar/config.hypr | 99 ++++++++++++++++++++++ .config/waybar/config.sway | 97 +++++++++++++++++++++ 5 files changed, 197 insertions(+), 6 deletions(-) delete mode 160000 .config/hypr/plugins/hy3 create mode 100644 .config/waybar/config.hypr create mode 100644 .config/waybar/config.sway diff --git a/.config/hypr/hyprland.conf.d/autoexec.conf b/.config/hypr/hyprland.conf.d/autoexec.conf index 61cf0f9..fef4041 100644 --- a/.config/hypr/hyprland.conf.d/autoexec.conf +++ b/.config/hypr/hyprland.conf.d/autoexec.conf @@ -1,7 +1,7 @@ # env setting for nvidia env = LIBVA_DRIVER_NAME,nvidia env = XDG_SESSION_TYPE,wayland -# env = GBM_BACKEND,nvidia-drm +env = GBM_BACKEND,nvidia-drm env = WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 env = __GLX_VENDOR_LIBRARY_NAME,nvidia env = WLR_NO_HARDWARE_CURSORS,1 diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf index 9c720fe..f73a87c 100644 --- a/.config/hypr/hyprland.conf.d/keybind.conf +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -27,10 +27,6 @@ bind = $mainMod + SHIFT, l, swapwindow, r bind = $mainMod + SHIFT, k, swapwindow, u bind = $mainMod + SHIFT, j, swapwindow, d -# Grouping -bind = $mainMod, t, togglegroup -bind = $mainMod, TAB, changegroupactive - # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 diff --git a/.config/hypr/plugins/hy3 b/.config/hypr/plugins/hy3 deleted file mode 160000 index 4db9b1f..0000000 --- a/.config/hypr/plugins/hy3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4db9b1f37a5f429aa5d103143176ba2f5dd20f16 diff --git a/.config/waybar/config.hypr b/.config/waybar/config.hypr new file mode 100644 index 0000000..ff9b591 --- /dev/null +++ b/.config/waybar/config.hypr @@ -0,0 +1,99 @@ +{ + "layer": "top", + "modules-left": [ + "hyprland/workspaces" + ], + "fixed-center": false, + "modules-center": [ + "hyprland/window" + ], + "modules-right": [ + "tray", + "custom/notification", + "custom/player", + "cpu", + "memory", + "network", + "battery", + "clock" + ], + "hyprland/workspaces": { + "on-scroll-up": "hyprctl dispatch workspace e-1", + "on-scroll-down": "hyprctl dispatch workspace e+1", + "show_special": true, + "on-click": "activate", + "persistent_workspaces": { + "9": ["HDMI-A-1"] + } + }, + "hyprland/window": { + "max-length": 50, + "separate-outputs": true + }, + "tray": { + "spacing": 10 + }, + "cpu": { + "format": " {load}", + "format-alt": " {usage}% @ {avg_frequency}GHz" + }, + "memory": { + "format": "󰍛 {used:0.1f}G / {total:0.1f}G", + "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" + }, + "network": { + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": "󰈀 {ifname}", + "format-linked": " {ifname}", + "format-disconnected": "󰌙 Disconnected", + "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", + "tooltip-format": "{ifname} via {gwaddr}" + }, + "battery": { + "states": { + "good": 75, + "warning": 15, + "critical": 5 + }, + "format": "{icon} {capacity}%", + "format-charging": "🗲 {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} ETA: {time}", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "clock": { + "format": "{:󰅐 %H:%M\t %m-%d}", + "tooltip-format": "{:%Y %B}\n{calendar}" + }, + "custom/notification": { + "tooltip": true, + "format": "{icon}", + "format-icons": { + "notification": " New notifications", + "none": " No notifications", + "dnd-notification": " DND on", + "dnd-none": " DND on" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "custom/player": { + "format": "󰎈 {}", + "return-type": "json", + "exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", + "max-length": 35, + "on-click-middle": "playerctl play-pause", + "on-click-right": "plaerctl next", + "on-click-left": "playerctl previous" + } +} diff --git a/.config/waybar/config.sway b/.config/waybar/config.sway new file mode 100644 index 0000000..d54093f --- /dev/null +++ b/.config/waybar/config.sway @@ -0,0 +1,97 @@ +{ + "layer": "top", + "modules-left": [ + "sway/workspaces" + ], + "fixed-center": false, + "modules-center": [ + "sway/window" + ], + "modules-right": [ + "tray", + "custom/notification", + "custom/player", + "cpu", + "memory", + "network", + "battery", + "clock" + ], + "sway/workspaces": { + "show_special": true, + "on-click": "activate", + "persistent_workspaces": { + "9": ["HDMI-A-1"] + } + }, + "sway/window": { + "max-length": 50, + "separate-outputs": true + }, + "tray": { + "spacing": 10 + }, + "cpu": { + "format": " {load}", + "format-alt": " {usage}% @ {avg_frequency}GHz" + }, + "memory": { + "format": "󰍛 {used:0.1f}G / {total:0.1f}G", + "format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G" + }, + "network": { + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": "󰈀 {ifname}", + "format-linked": " {ifname}", + "format-disconnected": "󰌙 Disconnected", + "format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}", + "tooltip-format": "{ifname} via {gwaddr}" + }, + "battery": { + "states": { + "good": 75, + "warning": 15, + "critical": 5 + }, + "format": "{icon} {capacity}%", + "format-charging": "🗲 {capacity}%", + "format-plugged": " {capacity}%", + "format-alt": "{icon} ETA: {time}", + "format-icons": [ + "", + "", + "", + "", + "" + ] + }, + "clock": { + "format": "{:󰅐 %H:%M\t %m-%d}", + "tooltip-format": "{:%Y %B}\n{calendar}" + }, + "custom/notification": { + "tooltip": true, + "format": "{icon}", + "format-icons": { + "notification": " New notifications", + "none": " No notifications", + "dnd-notification": " DND on", + "dnd-none": " DND on" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + "custom/player": { + "format": "󰎈 {}", + "return-type": "json", + "exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", + "max-length": 35, + "on-click-middle": "playerctl play-pause", + "on-click-right": "plaerctl next", + "on-click-left": "playerctl previous" + } +} From e08fe061df252ccd381fd4e9aaed0c0c2c14c824 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Dec 2023 13:36:10 +0800 Subject: [PATCH 12/28] Animation, lock, kitty integration --- .config/hypr/hyprland.conf.d/keybind.conf | 16 ++++++--------- .config/hypr/hyprland.conf.d/ui.conf | 10 ++++++++- .config/hypr/scripts/logout.sh | 25 +++++++++++++++++++++++ .config/kitty/kitty.conf | 4 ++++ .config/kitty/ssh.conf | 4 ++++ .zshrc | 15 ++++++++------ 6 files changed, 57 insertions(+), 17 deletions(-) create mode 100755 .config/hypr/scripts/logout.sh create mode 100644 .config/kitty/ssh.conf diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf index f73a87c..f884fbd 100644 --- a/.config/hypr/hyprland.conf.d/keybind.conf +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -1,7 +1,6 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, N, exec, kitty bind = $mainMod, W, killactive, bind = $mainMod + CTRL, Q, exit, @@ -9,6 +8,12 @@ bind = $mainMod + SHIFT, SPACE, togglefloating, bind = $mainMod + SHIFT, RETURN, exec, wofi --show drun bind = $mainMod + SHIFT, P, pseudo, # dwindle +# Software binds +bind = $mainMod CTRL, r, exec, hyprctl reload +bind = $mainMod CTRL, 65, exec, fcitx5-remote -t +bind = $mainMod, M, exec, swaync-client -t +bind = $mainMod CTRL, l, exec, ~/.config/hypr/scripts/logout.sh + # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r @@ -68,15 +73,6 @@ bind = $mainMod, mouse_up, workspace, e+1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow -# reload hyprland -bind = $mainMod CTRL, r, exec, hyprctl reload - -# change IME -bind = $mainMod CTRL, 65, exec, fcitx5-remote -t - -# open swayNC -bind = $mainMod, M, exec, swaync-client -t - # fn keys bind=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+ bindl=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- diff --git a/.config/hypr/hyprland.conf.d/ui.conf b/.config/hypr/hyprland.conf.d/ui.conf index 288f038..a5efdd9 100644 --- a/.config/hypr/hyprland.conf.d/ui.conf +++ b/.config/hypr/hyprland.conf.d/ui.conf @@ -22,7 +22,13 @@ decoration { } animations { - enabled = false + # enabled = false + bezier = easeInQuart, 0.5, 0, 0.75, 0 + bezier = easeInQuint, 0.64, 0, 0.78, 0 + animation = windows,1,2,easeInQuart, popin 80% + animation = workspaces,1,2,easeInQuint, slidefade 30% + animation = specialWorkspace,1,2,easeInQuint,slidefadevert 30% + animation = fade,1,1.2,easeInQuart } dwindle { @@ -52,3 +58,5 @@ misc { xwayland { force_zero_scaling = true } + +# vim: set filetype=conf: diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh new file mode 100755 index 0000000..394eae1 --- /dev/null +++ b/.config/hypr/scripts/logout.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Modified from sway's locking script + + +if [[ ! -e /bin/swayidle ]]; then + notify-send "ERROR" "Swayidle not found" + exit 1 +fi + +choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` +if test "$choice" = lock ; then + bright=`light` + swayidle -w \ + timeout 5 "light -S 1" resume "light -S $bright" \ + timeout 10 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ + & + idlepid=$! + swaylock -e -c 282828 --inside-color 00000003 + kill $idlepid + hyprctl dispatch dpms on + light -S $bright +else + loginctl $choice +fi diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 35373be..ec2c7bf 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -35,3 +35,7 @@ listen_on unix:/tmp/fifo map kitty_mod+n new_os_window_with_cwd include themes/dark.conf + +tab_bar_style fade + +tab_fade 0.00390625 0.0625 0.31640625 1 diff --git a/.config/kitty/ssh.conf b/.config/kitty/ssh.conf new file mode 100644 index 0000000..472ef36 --- /dev/null +++ b/.config/kitty/ssh.conf @@ -0,0 +1,4 @@ +# env ZDOTDIR=$HOME/.cache/kitty-zsh +# copy --dest .cache/kitty-zsh/.zshrc .zshrc + +copy .zshrc diff --git a/.zshrc b/.zshrc index 139de06..a01b300 100644 --- a/.zshrc +++ b/.zshrc @@ -16,16 +16,15 @@ source "$ZINIT_HOME/zinit.zsh" # Zinit packages +zinit ice compile'(pure|async).zsh' pick'async.zsh' src'pure.zsh' +zinit light sindresorhus/pure + zinit wait lucid for \ zdharma-continuum/fast-syntax-highlighting \ agkozak/zsh-z \ zpm-zsh/colorize \ - juancldcmt/shortify.zsh - -zinit ice as"command" from"gh-r" \ - atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ - atpull"%atclone" src"init.zsh" -zinit light starship/starship + juancldcmt/shortify.zsh \ + juancldcmt/kitty-zsh zinit light zsh-users/zsh-autosuggestions zinit light hlissner/zsh-autopair @@ -72,6 +71,10 @@ unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install +# Pure prompt +zstyle ':prompt:pure:git:stash' show yes +zstyle ':prompt:pure:prompt:success' color default + #edit in vim export KEYTIMEOUT=1 autoload edit-command-line From 2e9e35e80668193740f2ce6c73b61262ccf34322 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Dec 2023 14:28:53 +0800 Subject: [PATCH 13/28] Update screen locking --- .config/hypr/scripts/logout.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 394eae1..795b66e 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -3,9 +3,9 @@ # Modified from sway's locking script -if [[ ! -e /bin/swayidle ]]; then - notify-send "ERROR" "Swayidle not found" - exit 1 +if [[ ! $(which swayidle 2> /dev/null) ]]; then + notify-send "ERROR" "Swayidle not found" + exit 1 fi choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` @@ -16,10 +16,12 @@ if test "$choice" = lock ; then timeout 10 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ & idlepid=$! - swaylock -e -c 282828 --inside-color 00000003 + # swaylock -e -c 282828 --inside-color 00000003 + swaylock -S --effect-blur "5x5" --effect-vignette 0.5:0.5 --inside-color 00000003 \ + -e --ring-color 00000005 --line-color 00000035 kill $idlepid hyprctl dispatch dpms on light -S $bright -else +elif test -n "$choice"; then loginctl $choice fi From df203dc51c9d0fd151d7c7efc1274ef5a96660e7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Dec 2023 15:09:10 +0800 Subject: [PATCH 14/28] Add kitty --- .config/kitty/kitty.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index ec2c7bf..3169d1f 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -32,9 +32,15 @@ allow_remote_control yes listen_on unix:/tmp/fifo +include themes/dark.conf + map kitty_mod+n new_os_window_with_cwd -include themes/dark.conf +# tabs and windows + +map kitty_mod+t new_tab_with_cwd + +map kitty_mod+enter new_window_with_cwd tab_bar_style fade From b7863e2f6139552a2b593e13f1a84cb09291efb8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Dec 2023 16:56:43 +0800 Subject: [PATCH 15/28] Update sleep script --- .config/hypr/scripts/logout.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 795b66e..2d87c0b 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -8,19 +8,35 @@ if [[ ! $(which swayidle 2> /dev/null) ]]; then exit 1 fi -choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` +choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical) + + if test "$choice" = lock ; then + # sleep less when power on + if acpi -a | grep -q on; then + sleep_time=3600 + else + sleep_time=10 + fi + sleep 0.3 + bright=`light` + swayidle -w \ timeout 5 "light -S 1" resume "light -S $bright" \ - timeout 10 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ + timeout $sleep_time 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ & idlepid=$! + # swaylock -e -c 282828 --inside-color 00000003 - swaylock -S --effect-blur "5x5" --effect-vignette 0.5:0.5 --inside-color 00000003 \ - -e --ring-color 00000005 --line-color 00000035 + swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 00000000 \ + -e --ring-color 00000000 --line-uses-inside --indicator --clock --text-color 689d6a + kill $idlepid + + pkill waybar hyprctl dispatch dpms on + hyprctl dispatch exec waybar light -S $bright elif test -n "$choice"; then loginctl $choice From 72fe3f24924556af4f6e13b66b46e5aee4648028 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 7 Dec 2023 11:31:31 +0800 Subject: [PATCH 16/28] Update --- .config/hypr/hyprland.conf.d/autoexec.conf | 2 +- .config/hypr/hyprland.conf.d/keybind.conf | 2 ++ .config/hypr/scripts/logout.sh | 6 +++--- .config/starship.toml | 5 ----- .config/waybar/config | 2 +- .zshrc | 13 ++++++++++--- 6 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 .config/starship.toml diff --git a/.config/hypr/hyprland.conf.d/autoexec.conf b/.config/hypr/hyprland.conf.d/autoexec.conf index fef4041..bd910c1 100644 --- a/.config/hypr/hyprland.conf.d/autoexec.conf +++ b/.config/hypr/hyprland.conf.d/autoexec.conf @@ -8,7 +8,7 @@ env = WLR_NO_HARDWARE_CURSORS,1 # Execute your favorite apps at launch exec=pidof -q hyprpaper || hyprpaper -exec=pidof -q wlsunset || wlsunset -S 08:00 -s 19:00 +exec=pidof -q wlsunset || wlsunset -S 08:00 -s 19:00 -d 1800 exec=pidof -q waybar || waybar exec=~/.config/hypr/scripts/clamshell.sh exec-once=fcitx5 -d diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf index f884fbd..b78fced 100644 --- a/.config/hypr/hyprland.conf.d/keybind.conf +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -13,6 +13,8 @@ bind = $mainMod CTRL, r, exec, hyprctl reload bind = $mainMod CTRL, 65, exec, fcitx5-remote -t bind = $mainMod, M, exec, swaync-client -t bind = $mainMod CTRL, l, exec, ~/.config/hypr/scripts/logout.sh +# TODO: use a script instead +bind = $mainMod SHIFT, s, exec, hyprshot --clipboard-only -m region # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 2d87c0b..66b76bc 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -29,8 +29,8 @@ if test "$choice" = lock ; then idlepid=$! # swaylock -e -c 282828 --inside-color 00000003 - swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 00000000 \ - -e --ring-color 00000000 --line-uses-inside --indicator --clock --text-color 689d6a + swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 28282860 \ + -e --ring-color 00000000 --line-color 00000000 --indicator --clock --text-color ebdbb2 kill $idlepid @@ -39,5 +39,5 @@ if test "$choice" = lock ; then hyprctl dispatch exec waybar light -S $bright elif test -n "$choice"; then - loginctl $choice + systemctl $choice fi diff --git a/.config/starship.toml b/.config/starship.toml deleted file mode 100644 index 77812a0..0000000 --- a/.config/starship.toml +++ /dev/null @@ -1,5 +0,0 @@ -# Get editor completions based on the config schema -"$schema" = 'https://starship.rs/config-schema.json' - -# Inserts a blank line between shell prompts -add_newline = true diff --git a/.config/waybar/config b/.config/waybar/config index ff9b591..c446c6b 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -91,7 +91,7 @@ "format": "󰎈 {}", "return-type": "json", "exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", - "max-length": 35, + "max-length": 50, "on-click-middle": "playerctl play-pause", "on-click-right": "plaerctl next", "on-click-left": "playerctl previous" diff --git a/.zshrc b/.zshrc index a01b300..b2fe49e 100644 --- a/.zshrc +++ b/.zshrc @@ -22,6 +22,7 @@ zinit light sindresorhus/pure zinit wait lucid for \ zdharma-continuum/fast-syntax-highlighting \ agkozak/zsh-z \ + zpm-zsh/colors \ zpm-zsh/colorize \ juancldcmt/shortify.zsh \ juancldcmt/kitty-zsh @@ -31,6 +32,15 @@ zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-history-substring-search zinit light zsh-users/zsh-completions +# Software +zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat" +zinit light sharkdp/bat + +zinit from"gh-r" as"program" mv"direnv* -> direnv" \ + atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ + pick"direnv" src="zhook.zsh" for \ + direnv/direnv + autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit @@ -112,10 +122,7 @@ export HISTORY_SUBSTRING_SEARCH_FUZZY=1 #colored output export MANWIDTH=${MANWIDTH:-78} -test -e /bin/nvim && export MANPAGER='nvim +Man!' || \ - export MANLESS="Manual\ \$MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\:?pB\ %pB\\%.." test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' -export LESS="--use-color -RSM~" #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" From f0a0d3cd18e251af1aa8cd505a36950af4d1b1a2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 9 Dec 2023 19:36:58 +0800 Subject: [PATCH 17/28] Optimize zshrc --- .zshrc | 18 +++++++----------- README.md | 4 ++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.zshrc b/.zshrc index b2fe49e..081bb33 100644 --- a/.zshrc +++ b/.zshrc @@ -27,7 +27,9 @@ zinit wait lucid for \ juancldcmt/shortify.zsh \ juancldcmt/kitty-zsh +zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start' zinit light zsh-users/zsh-autosuggestions + zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-history-substring-search zinit light zsh-users/zsh-completions @@ -44,6 +46,7 @@ zinit from"gh-r" as"program" mv"direnv* -> direnv" \ autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit +test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' # The following lines were added by compinstall zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f' @@ -78,7 +81,7 @@ HISTSIZE=8192 SAVEHIST=8192 setopt autocd extendedglob nomatch notify auto_pushd unsetopt beep -bindkey -v +bindkey -e # End of lines configured by zsh-newuser-install # Pure prompt @@ -86,10 +89,9 @@ zstyle ':prompt:pure:git:stash' show yes zstyle ':prompt:pure:prompt:success' color default #edit in vim -export KEYTIMEOUT=1 autoload edit-command-line zle -N edit-command-line -bindkey '' edit-command-line +bindkey '' edit-command-line zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char @@ -104,10 +106,9 @@ bindkey '' history-substring-search-down bindkey ' ' magic-space -bindkey '' autosuggest-execute - #config location export GOPATH=$HOME/.cache/go +export CARGO_HOME=$HOME/.cache/cargo export LESSHISTFILE=/dev/null export LYNX_CFG=$HOME/.config/lynx/lynxrc export XDG_CACHE_HOME=$HOME/.cache @@ -116,13 +117,8 @@ export XDG_CONFIG_HOME=$HOME/.config #settings for software export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎" export GPG_TTY=$(tty) # fixes gpg -export JDK_HOME=/usr/lib/jvm/openjdk-17 -export _JAVA_AWT_WM_NONREPARENTING=1 -export HISTORY_SUBSTRING_SEARCH_FUZZY=1 - -#colored output export MANWIDTH=${MANWIDTH:-78} -test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' +export HISTORY_SUBSTRING_SEARCH_FUZZY=1 #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" diff --git a/README.md b/README.md index 74647f1..5f399fc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Linux desktop with gruvbox colorscheme, following the KISS philosophy. +## TODO + +- [ ] Use [zim](https://github.com/zimfw/zimfw) + # Screenshots ![terminal](https://user-images.githubusercontent.com/72336775/176679848-a66143cb-0df8-4fd0-a567-66693c33741e.png) From 7ede139619ce31571abff7446cf55d69af13716f Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 12 Dec 2023 10:32:40 +0800 Subject: [PATCH 18/28] Better colors --- .zshrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 081bb33..35292f4 100644 --- a/.zshrc +++ b/.zshrc @@ -30,8 +30,8 @@ zinit wait lucid for \ zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start' zinit light zsh-users/zsh-autosuggestions -zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-history-substring-search +zinit light hlissner/zsh-autopair zinit light zsh-users/zsh-completions # Software @@ -117,8 +117,13 @@ export XDG_CONFIG_HOME=$HOME/.config #settings for software export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎" export GPG_TTY=$(tty) # fixes gpg -export MANWIDTH=${MANWIDTH:-78} export HISTORY_SUBSTRING_SEARCH_FUZZY=1 +export MANWIDTH=${MANWIDTH:-78} +export MANROFFOPT="-c" +export BAT_THEME="ansi" + +# bat pager +alias -g -- --help='--help 2>&1 | bat --language=help --style=plain' #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" From 4a6f6a0ad0f76c5aaa513f8069fb99485c214dd0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 12 Dec 2023 10:55:43 +0800 Subject: [PATCH 19/28] docs(readme): Add todo --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5f399fc..b15f9f5 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Linux desktop with gruvbox colorscheme, following the KISS philosophy. ## TODO - [ ] Use [zim](https://github.com/zimfw/zimfw) +- [ ] Update screenshots (It's using serenade instead of gruvbox) # Screenshots From cba85e62956fa03980185aa8cc5ea0b20070fbd3 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 13 Dec 2023 14:04:24 +0800 Subject: [PATCH 20/28] Optimize zsh --- .zshrc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index 35292f4..8f0f6fa 100644 --- a/.zshrc +++ b/.zshrc @@ -30,9 +30,11 @@ zinit wait lucid for \ zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start' zinit light zsh-users/zsh-autosuggestions -zinit light zsh-users/zsh-history-substring-search -zinit light hlissner/zsh-autopair +zinit ice wait lucid +zinit load hlissner/zsh-autopair + zinit light zsh-users/zsh-completions +zinit light zsh-users/zsh-history-substring-search # Software zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat" @@ -41,7 +43,7 @@ zinit light sharkdp/bat zinit from"gh-r" as"program" mv"direnv* -> direnv" \ atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ pick"direnv" src="zhook.zsh" for \ - direnv/direnv + direnv/direnv autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit @@ -122,9 +124,6 @@ export MANWIDTH=${MANWIDTH:-78} export MANROFFOPT="-c" export BAT_THEME="ansi" -# bat pager -alias -g -- --help='--help 2>&1 | bat --language=help --style=plain' - #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" export MANPATH="${MANPATH}:${HOME}/.local/share/man" From 851557200a675d60c03aee17570fa6f2a936d80a Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 15 Dec 2023 12:39:58 +0800 Subject: [PATCH 21/28] Update font --- .config/hypr/scripts/logout.sh | 4 +--- .config/kitty/kitty.conf | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 66b76bc..8538b60 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -23,9 +23,7 @@ if test "$choice" = lock ; then bright=`light` swayidle -w \ - timeout 5 "light -S 1" resume "light -S $bright" \ - timeout $sleep_time 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ - & + timeout 5 "light -S 1" resume "light -S $bright" & idlepid=$! # swaylock -e -c 282828 --inside-color 00000003 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 3169d1f..b546f74 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1,10 +1,10 @@ #set font and stuff -font_family IBM Plex Mono -bold_font IBM Plex Mono SemiBold -italic_font IBM Plex Mono Italic -bold_italic_font IBM Plex Mono SemiBold Italic +font_family Iosevka Term SS15 +bold_font Iosevka Term SS15 Bold +italic_font Iosevka Term SS15 Italic +bold_italic_font Iosevka Term SS15 Bold Italic -font_size 13.5 +font_size 14 symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B Symbols Nerd Font Mono From 7c19cae6eba72168958e36f6fa28dc8515fcccac Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 15 Dec 2023 13:57:38 +0800 Subject: [PATCH 22/28] Refractor --- .config/hypr/scripts/logout.sh | 4 +++- .config/qt5ct/dark.conf | 4 ++-- .config/qt5ct/light.conf | 4 ++-- .config/qt6ct/dark.conf | 4 ++-- .config/qt6ct/light.conf | 4 ++-- .config/sway/scripts/logout.sh | 27 +++++++++++++++++++++++---- .config/sway/scripts/themes.sh | 2 +- 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 8538b60..66b76bc 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -23,7 +23,9 @@ if test "$choice" = lock ; then bright=`light` swayidle -w \ - timeout 5 "light -S 1" resume "light -S $bright" & + timeout 5 "light -S 1" resume "light -S $bright" \ + timeout $sleep_time 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \ + & idlepid=$! # swaylock -e -c 282828 --inside-color 00000003 diff --git a/.config/qt5ct/dark.conf b/.config/qt5ct/dark.conf index a379cb6..e10d7ab 100644 --- a/.config/qt5ct/dark.conf +++ b/.config/qt5ct/dark.conf @@ -6,8 +6,8 @@ standard_dialogs=gtk3 style=Adwaita-Dark [Fonts] -fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) -general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +fixed=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0M\0o\0n\0o@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) [Interface] activate_item_on_single_click=1 diff --git a/.config/qt5ct/light.conf b/.config/qt5ct/light.conf index d7c18a8..3d02ce9 100644 --- a/.config/qt5ct/light.conf +++ b/.config/qt5ct/light.conf @@ -6,8 +6,8 @@ standard_dialogs=gtk3 style=Adwaita [Fonts] -fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) -general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +fixed=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0M\0o\0n\0o@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) [Interface] activate_item_on_single_click=1 diff --git a/.config/qt6ct/dark.conf b/.config/qt6ct/dark.conf index b6e1593..0b500e0 100644 --- a/.config/qt6ct/dark.conf +++ b/.config/qt6ct/dark.conf @@ -6,8 +6,8 @@ standard_dialogs=gtk3 style=Adwaita-Dark [Fonts] -fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" -general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +fixed="IBM Plex Mono,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="IBM Plex Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" [Interface] activate_item_on_single_click=1 diff --git a/.config/qt6ct/light.conf b/.config/qt6ct/light.conf index 0e33c58..1ce97ea 100644 --- a/.config/qt6ct/light.conf +++ b/.config/qt6ct/light.conf @@ -6,8 +6,8 @@ standard_dialogs=gtk3 style=Adwaita [Fonts] -fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" -general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +fixed="IBM Plex Mono,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" +general="IBM Plex Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1" [Interface] activate_item_on_single_click=1 diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index e2fb54a..04db738 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -1,17 +1,36 @@ #!/bin/sh +# +# Modified from sway's locking script + + +if [[ ! $(which swayidle 2> /dev/null) ]]; then + notify-send "ERROR" "Swayidle not found" + exit 1 +fi + +choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical) + -choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical` if test "$choice" = lock ; then + # sleep less when power on + if acpi -a | grep -q on; then + sleep_time=3600 + else + sleep_time=10 + fi + sleep 0.3 + bright=`light` + swayidle -w \ timeout 5 "light -S 1" resume "light -S $bright" \ - timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + timeout $sleep_time 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ & idlepid=$! swaylock -e -c 282828 --inside-color 00000003 kill $idlepid swaymsg "output * power on" light -S $bright -else - loginctl $choice +elif test -n "$choice"; then + systemctl $choice fi diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index bd3b292..90dbe5d 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -46,4 +46,4 @@ else ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper fi -sway reload +hyprctl reload From e9b51b16db00802f6ba2e93912f0da017f73172d Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 28 Dec 2023 22:02:02 +0800 Subject: [PATCH 23/28] Better zsh --- .config/hypr/scripts/logout.sh | 4 ++-- .zshrc | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.config/hypr/scripts/logout.sh b/.config/hypr/scripts/logout.sh index 66b76bc..30c2a54 100755 --- a/.config/hypr/scripts/logout.sh +++ b/.config/hypr/scripts/logout.sh @@ -12,9 +12,9 @@ choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt if test "$choice" = lock ; then - # sleep less when power on + # don't sleep when power on if acpi -a | grep -q on; then - sleep_time=3600 + sleep_time=86400 else sleep_time=10 fi diff --git a/.zshrc b/.zshrc index 8f0f6fa..358fcdf 100644 --- a/.zshrc +++ b/.zshrc @@ -91,10 +91,14 @@ zstyle ':prompt:pure:git:stash' show yes zstyle ':prompt:pure:prompt:success' color default #edit in vim -autoload edit-command-line +autoload -Uz edit-command-line zle -N edit-command-line bindkey '' edit-command-line +# better CTRL-w +autoload -Uz select-word-style +select-word-style bash + zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history @@ -125,7 +129,7 @@ export MANROFFOPT="-c" export BAT_THEME="ansi" #local path -export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" +export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin}" export MANPATH="${MANPATH}:${HOME}/.local/share/man" #ccache support From 19a0078a6a274651173111ace991cef0a309c5da Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 2 Jan 2024 11:55:08 +0800 Subject: [PATCH 24/28] zsh, and hyprland --- .config/hypr/hyprland.conf.d/keybind.conf | 2 +- .config/hypr/hyprland.conf.d/ui.conf | 2 +- .config/waybar/config | 2 +- .zshrc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/hypr/hyprland.conf.d/keybind.conf b/.config/hypr/hyprland.conf.d/keybind.conf index b78fced..c3f2ed8 100644 --- a/.config/hypr/hyprland.conf.d/keybind.conf +++ b/.config/hypr/hyprland.conf.d/keybind.conf @@ -14,7 +14,7 @@ bind = $mainMod CTRL, 65, exec, fcitx5-remote -t bind = $mainMod, M, exec, swaync-client -t bind = $mainMod CTRL, l, exec, ~/.config/hypr/scripts/logout.sh # TODO: use a script instead -bind = $mainMod SHIFT, s, exec, hyprshot --clipboard-only -m region +bind = $mainMod SHIFT, s, exec, hyprshot --clipboard-only -m region -s # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l diff --git a/.config/hypr/hyprland.conf.d/ui.conf b/.config/hypr/hyprland.conf.d/ui.conf index a5efdd9..98a0198 100644 --- a/.config/hypr/hyprland.conf.d/ui.conf +++ b/.config/hypr/hyprland.conf.d/ui.conf @@ -22,7 +22,7 @@ decoration { } animations { - # enabled = false + enabled = false bezier = easeInQuart, 0.5, 0, 0.75, 0 bezier = easeInQuint, 0.64, 0, 0.78, 0 animation = windows,1,2,easeInQuart, popin 80% diff --git a/.config/waybar/config b/.config/waybar/config index c446c6b..ff9b591 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -91,7 +91,7 @@ "format": "󰎈 {}", "return-type": "json", "exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F", - "max-length": 50, + "max-length": 35, "on-click-middle": "playerctl play-pause", "on-click-right": "plaerctl next", "on-click-left": "playerctl previous" diff --git a/.zshrc b/.zshrc index 358fcdf..e14b122 100644 --- a/.zshrc +++ b/.zshrc @@ -126,7 +126,7 @@ export GPG_TTY=$(tty) # fixes gpg export HISTORY_SUBSTRING_SEARCH_FUZZY=1 export MANWIDTH=${MANWIDTH:-78} export MANROFFOPT="-c" -export BAT_THEME="ansi" +export BAT_THEME="base16" #local path export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin}" From fa14f7c34e4c8216bef3572368dfd9555643b6e8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 5 Jan 2024 18:34:36 +0800 Subject: [PATCH 25/28] swayWM, ditch hyprland --- .config/sway/config.d/custom.d/outputs | 8 ++++++-- .config/sway/scripts/logout.sh | 6 +++++- .config/waybar/config | 10 ++++------ .zshrc | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.config/sway/config.d/custom.d/outputs b/.config/sway/config.d/custom.d/outputs index 4438f66..d619fd2 100644 --- a/.config/sway/config.d/custom.d/outputs +++ b/.config/sway/config.d/custom.d/outputs @@ -1,6 +1,7 @@ # 75hz monitor output 'Lectron Company Ltd LECOO M2412HL GG30A137' mode 2560x1440@74.968Hz output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb +output 'Lectron Company Ltd LECOO M2412HL GG30A137' pos 0 500 # output 'Lectron Company Ltd LECOO M2412HL GG30A137' max_render_time 5 # output 'Lectron Company Ltd LECOO M2412HL GG30A137' render_bit_depth 10 @@ -19,6 +20,9 @@ output 'Unknown HUAWEI INC 0x00000000' mode 3840x2160@60.000Hz output 'Unknown HUAWEI INC 0x00000000' scale 2 # lab screen +# output "XMI Redmi 27 NU 3948622WH08F4" mode 1920x1080@60.000Hz output "XMI Redmi 27 NU 3948622WH08F4" transform 90 -# output "XMI Redmi 27 NU 3948622WH08F4" max_render_time 5 -# output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb +output "XMI Redmi 27 NU 3948622WH08F4" max_render_time 3 +output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb +output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 +output "XMI Redmi 27 NU 3948622WH08F4" pos 2560 0 diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index 04db738..49154c7 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -27,7 +27,11 @@ if test "$choice" = lock ; then timeout $sleep_time 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ & idlepid=$! - swaylock -e -c 282828 --inside-color 00000003 + + # swaylock -e -c 282828 --inside-color 00000003 + swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 28282860 \ + -e --ring-color 00000000 --line-color 00000000 --indicator --clock --text-color ebdbb2 + kill $idlepid swaymsg "output * power on" light -S $bright diff --git a/.config/waybar/config b/.config/waybar/config index ff9b591..d54093f 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -1,11 +1,11 @@ { "layer": "top", "modules-left": [ - "hyprland/workspaces" + "sway/workspaces" ], "fixed-center": false, "modules-center": [ - "hyprland/window" + "sway/window" ], "modules-right": [ "tray", @@ -17,16 +17,14 @@ "battery", "clock" ], - "hyprland/workspaces": { - "on-scroll-up": "hyprctl dispatch workspace e-1", - "on-scroll-down": "hyprctl dispatch workspace e+1", + "sway/workspaces": { "show_special": true, "on-click": "activate", "persistent_workspaces": { "9": ["HDMI-A-1"] } }, - "hyprland/window": { + "sway/window": { "max-length": 50, "separate-outputs": true }, diff --git a/.zshrc b/.zshrc index e14b122..f7dd10e 100644 --- a/.zshrc +++ b/.zshrc @@ -129,7 +129,7 @@ export MANROFFOPT="-c" export BAT_THEME="base16" #local path -export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin}" +export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" export MANPATH="${MANPATH}:${HOME}/.local/share/man" #ccache support From d4c4898bc47505aa599fb773dbdb15a83d04c81c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 6 Jan 2024 11:35:43 +0800 Subject: [PATCH 26/28] SwayWM --- .config/sway/conf.d/custom | 3 + .../sway/{config.d => conf.d}/custom.d/fedora | 0 .../custom.d/input-settings | 0 .../{config.d => conf.d}/custom.d/outputs | 19 ++- .config/sway/{config.d => conf.d}/display | 0 .config/sway/{config.d => conf.d}/exec | 0 .config/sway/{config.d => conf.d}/keybinds | 8 +- .config/sway/conf.d/theme | 3 + .config/sway/{config.d => conf.d}/themes/dark | 2 +- .../sway/{config.d => conf.d}/themes/light | 0 .config/sway/config | 12 +- .config/sway/config.d/custom | 3 - .config/sway/config.d/theme | 3 - .config/sway/scripts/boxshadow.sh | 13 -- .config/sway/scripts/grimshot-ui.sh | 22 --- .config/sway/scripts/grimshot.sh | 156 ------------------ .config/sway/scripts/logout.sh | 5 +- .config/sway/scripts/themes.sh | 2 +- .zshrc | 3 + 19 files changed, 33 insertions(+), 221 deletions(-) create mode 100644 .config/sway/conf.d/custom rename .config/sway/{config.d => conf.d}/custom.d/fedora (100%) rename .config/sway/{config.d => conf.d}/custom.d/input-settings (100%) rename .config/sway/{config.d => conf.d}/custom.d/outputs (71%) rename .config/sway/{config.d => conf.d}/display (100%) rename .config/sway/{config.d => conf.d}/exec (100%) rename .config/sway/{config.d => conf.d}/keybinds (89%) create mode 100644 .config/sway/conf.d/theme rename .config/sway/{config.d => conf.d}/themes/dark (94%) rename .config/sway/{config.d => conf.d}/themes/light (100%) delete mode 100644 .config/sway/config.d/custom delete mode 100644 .config/sway/config.d/theme delete mode 100755 .config/sway/scripts/boxshadow.sh delete mode 100755 .config/sway/scripts/grimshot-ui.sh delete mode 100755 .config/sway/scripts/grimshot.sh diff --git a/.config/sway/conf.d/custom b/.config/sway/conf.d/custom new file mode 100644 index 0000000..2bde2b8 --- /dev/null +++ b/.config/sway/conf.d/custom @@ -0,0 +1,3 @@ +# vim: filetype=swayconfig + +include ~/.config/sway/conf.d/custom.d/* diff --git a/.config/sway/config.d/custom.d/fedora b/.config/sway/conf.d/custom.d/fedora similarity index 100% rename from .config/sway/config.d/custom.d/fedora rename to .config/sway/conf.d/custom.d/fedora diff --git a/.config/sway/config.d/custom.d/input-settings b/.config/sway/conf.d/custom.d/input-settings similarity index 100% rename from .config/sway/config.d/custom.d/input-settings rename to .config/sway/conf.d/custom.d/input-settings diff --git a/.config/sway/config.d/custom.d/outputs b/.config/sway/conf.d/custom.d/outputs similarity index 71% rename from .config/sway/config.d/custom.d/outputs rename to .config/sway/conf.d/custom.d/outputs index d619fd2..c19143f 100644 --- a/.config/sway/config.d/custom.d/outputs +++ b/.config/sway/conf.d/custom.d/outputs @@ -1,18 +1,18 @@ +output * adaptive_sync on + # 75hz monitor output 'Lectron Company Ltd LECOO M2412HL GG30A137' mode 2560x1440@74.968Hz output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb output 'Lectron Company Ltd LECOO M2412HL GG30A137' pos 0 500 # output 'Lectron Company Ltd LECOO M2412HL GG30A137' max_render_time 5 -# output 'Lectron Company Ltd LECOO M2412HL GG30A137' render_bit_depth 10 - -output * adaptive_sync on +output 'Lectron Company Ltd LECOO M2412HL GG30A137' render_bit_depth 10 # laptop screen output 'Thermotrex Corporation TL160ADMP03-0 Unknown' subpixel rgb # output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@60.000Hz # output 'Thermotrex Corporation TL160ADMP03-0 Unknown' max_render_time 5 -output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@240.000Hz -output 'Thermotrex Corporation TL160ADMP03-0 Unknown' max_render_time 8 +output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@60.000Hz +# output 'Thermotrex Corporation TL160ADMP03-0 Unknown' max_render_time 8 # output 'Thermotrex Corporation TL160ADMP03-0 Unknown' render_bit_depth 10 # TV at home @@ -20,9 +20,10 @@ output 'Unknown HUAWEI INC 0x00000000' mode 3840x2160@60.000Hz output 'Unknown HUAWEI INC 0x00000000' scale 2 # lab screen -# output "XMI Redmi 27 NU 3948622WH08F4" mode 1920x1080@60.000Hz +output "XMI Redmi 27 NU 3948622WH08F4" mode --custom 2560x1440@75.000Hz output "XMI Redmi 27 NU 3948622WH08F4" transform 90 -output "XMI Redmi 27 NU 3948622WH08F4" max_render_time 3 -output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb -output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 output "XMI Redmi 27 NU 3948622WH08F4" pos 2560 0 +output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb +# output "XMI Redmi 27 NU 3948622WH08F4" max_render_time off +# output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 +output "XMI Redmi 27 NU 3948622WH08F4" render_bit_depth 10 diff --git a/.config/sway/config.d/display b/.config/sway/conf.d/display similarity index 100% rename from .config/sway/config.d/display rename to .config/sway/conf.d/display diff --git a/.config/sway/config.d/exec b/.config/sway/conf.d/exec similarity index 100% rename from .config/sway/config.d/exec rename to .config/sway/conf.d/exec diff --git a/.config/sway/config.d/keybinds b/.config/sway/conf.d/keybinds similarity index 89% rename from .config/sway/config.d/keybinds rename to .config/sway/conf.d/keybinds index bec5f61..0d651bf 100644 --- a/.config/sway/config.d/keybinds +++ b/.config/sway/conf.d/keybinds @@ -11,8 +11,8 @@ set $menu wofi # my keybinds # screenshot -bindsym $mod+Print exec ~/.config/sway/scripts/grimshot-ui.sh -bindsym $mod+Shift+s exec ~/.config/sway/scripts/grimshot-ui.sh +bindsym $mod+Print exec grimshot --cursor copy area +bindsym $mod+Shift+s exec grimshot --cursor copy area # notification client bindsym $mod+m exec swaync-client -t -sw # Logout @@ -36,8 +36,8 @@ bindsym --whole-window $mod+button9 workspace next # bind fn keys bindsym XF86AudioMicMute exec amixer set Capture toggle exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +3% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob -bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -3% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob +bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob +bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/scripts/getmute.sh > $SWAYSOCK.wob bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob diff --git a/.config/sway/conf.d/theme b/.config/sway/conf.d/theme new file mode 100644 index 0000000..4f3b303 --- /dev/null +++ b/.config/sway/conf.d/theme @@ -0,0 +1,3 @@ +# vim: filetype=swayconfig + +include ~/.config/sway/conf.d/themes/dark diff --git a/.config/sway/config.d/themes/dark b/.config/sway/conf.d/themes/dark similarity index 94% rename from .config/sway/config.d/themes/dark rename to .config/sway/conf.d/themes/dark index 07c5e38..d6a51d1 100644 --- a/.config/sway/config.d/themes/dark +++ b/.config/sway/conf.d/themes/dark @@ -4,7 +4,7 @@ set $gnome-schema org.gnome.desktop.interface exec_always { gsettings set $gnome-schema color-scheme 'prefer-dark' - gsettings set $gnome-schema gtk-theme 'Adwaita-dark' + gsettings set $gnome-schema gtk-theme 'Adwaita' gsettings set $gnome-schema icon-theme 'Papirus-Dark' gsettings set $gnome-schema cursor-theme 'Adwaita' gsettings set $gnome-schema font-name 'ibm-plex 12' diff --git a/.config/sway/config.d/themes/light b/.config/sway/conf.d/themes/light similarity index 100% rename from .config/sway/config.d/themes/light rename to .config/sway/conf.d/themes/light diff --git a/.config/sway/config b/.config/sway/config index a5d2b0a..e2badd0 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,7 +1,5 @@ -include ~/.config/sway/config.d/display -include ~/.config/sway/config.d/theme -include ~/.config/sway/config.d/keybinds -include ~/.config/sway/config.d/custom -include ~/.config/sway/config.d/exec - -exec kitty +include ~/.config/sway/conf.d/display +include ~/.config/sway/conf.d/theme +include ~/.config/sway/conf.d/keybinds +include ~/.config/sway/conf.d/custom +include ~/.config/sway/conf.d/exec diff --git a/.config/sway/config.d/custom b/.config/sway/config.d/custom deleted file mode 100644 index 6023060..0000000 --- a/.config/sway/config.d/custom +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=swayconfig - -include ~/.config/sway/config.d/custom.d/* diff --git a/.config/sway/config.d/theme b/.config/sway/config.d/theme deleted file mode 100644 index eb8f44c..0000000 --- a/.config/sway/config.d/theme +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=swayconfig - -include ~/.config/sway/config.d/themes/dark diff --git a/.config/sway/scripts/boxshadow.sh b/.config/sway/scripts/boxshadow.sh deleted file mode 100755 index 719548e..0000000 --- a/.config/sway/scripts/boxshadow.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Take $1 as input, add a box shadow, output to $2 - -# you can change background color here -background_color=none - -convert $1 \ - \( -clone 0 -background black -shadow 40x5+12+16 \) \ - \( -clone 0 -background black -shadow 40x5-4-4 \) \ - \( -clone 0 -background black -shadow 40x12+12-4 \) \ - \( -clone 0 -background black -shadow 40x12-4+16 \) \ - -reverse -background $background_color -layers merge +repage \ - $2 diff --git a/.config/sway/scripts/grimshot-ui.sh b/.config/sway/scripts/grimshot-ui.sh deleted file mode 100755 index 33b2b3d..0000000 --- a/.config/sway/scripts/grimshot-ui.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -SCRIPT_LOC=~/.config/sway/scripts/ -FOLDER=~/Pictures/Screenshots/ -# FILE="/tmp/share/screenshots/`date +'%y%m%d%H%M.png'`" -FILE="$FOLDER`date +'%y%m%d%H%M.png'`" - -action=`echo -e "copy\nsave" | wofi -d -Oalphabetical --prompt="Select your action"` -target=`echo -e "active\nscreen\noutput\narea\nwindow" | wofi -d -Oalphabetical --prompt="Select the target"` - -test $action || exit -test $target || exit - -# test -d /tmp/share/screenshot || mkdir -p /tmp/share/screenshots - -~/.config/sway/scripts/grimshot.sh --notify $action $target $FILE - -if [ $target = "active" ] || [ $target = "window" ] || [ $target = "area" ] -then - $SCRIPT_LOC/boxshadow.sh "$FILE" "$FILE" || die "Unable to save screenshot" - echo -e "saved file" -fi diff --git a/.config/sway/scripts/grimshot.sh b/.config/sway/scripts/grimshot.sh deleted file mode 100755 index 7b65c9c..0000000 --- a/.config/sway/scripts/grimshot.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh - -## TAKEN FROM https://github.com/swaywm/sway/blob/master/contrib/grimshot -## -## Grimshot: a helper for screenshots within sway -## Requirements: -## - `grim`: screenshot utility for wayland -## - `slurp`: to select an area -## - `swaymsg`: to read properties of current window -## - `wl-copy`: clipboard utility -## - `jq`: json utility to parse swaymsg output -## - `notify-send`: to show notifications -## Those are needed to be installed, if unsure, run `grimshot check` -## -## See `man 1 grimshot` or `grimshot usage` for further details. - -getTargetDirectory() { - test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ - . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs - - echo ${XDG_SCREENSHOTS_DIR:-${XDG_PICTURES_DIR:-$HOME}} -} - -if [ "$1" = "--notify" ]; then - NOTIFY=yes - shift 1 -else - NOTIFY=no -fi - -ACTION=${1:-usage} -SUBJECT=${2:-screen} -FILE=${3:-$(getTargetDirectory)/$(date +'%y%m%d%H%M.png')} - -if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then - echo "Usage:" - echo " grimshot [--notify] (copy|save) [active|screen|output|area|window] [FILE|-]" - echo " grimshot check" - echo " grimshot usage" - echo "" - echo "Commands:" - echo " copy: Copy the screenshot data into the clipboard." - echo " save: Save the screenshot to a regular file or '-' to pipe to STDOUT." - echo " check: Verify if required tools are installed and exit." - echo " usage: Show this message and exit." - echo "" - echo "Targets:" - echo " active: Currently active window." - echo " screen: All visible outputs." - echo " output: Currently active output." - echo " area: Manually select a region." - echo " window: Manually select a window." - exit -fi - -notify() { - notify-send -t 3000 -a grimshot "$@" -} -notifyOk() { - [ "$NOTIFY" = "no" ] && return - - TITLE=${2:-"Screenshot"} - MESSAGE=${1:-"OK"} - notify-send "$TITLE" "$MESSAGE" -} -notifyError() { - if [ $NOTIFY = "yes" ]; then - TITLE=${2:-"Screenshot"} - MESSAGE=${1:-"Error taking screenshot with grim"} - notify -u critical "$TITLE" "$MESSAGE" - else - echo $1 - fi -} - -die() { - MSG=${1:-Bye} - notifyError "Error: $MSG" - exit 2 -} - -check() { - COMMAND=$1 - if command -v "$COMMAND" > /dev/null 2>&1; then - RESULT="OK" - else - RESULT="NOT FOUND" - fi - echo " $COMMAND: $RESULT" -} - -takeScreenshot() { - FILE=$1 - GEOM=$2 - OUTPUT=$3 - if [ ! -z "$OUTPUT" ]; then - grim -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" - elif [ -z "$GEOM" ]; then - grim "$FILE" || die "Unable to invoke grim" - else - grim -g "$GEOM" "$FILE" || die "Unable to invoke grim" - fi -} - -if [ "$ACTION" = "check" ] ; then - echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..." - check grim - check slurp - check swaymsg - check wl-copy - check jq - check notify-send - exit -elif [ "$SUBJECT" = "area" ] ; then - GEOM=$(slurp -d) - # Check if user exited slurp without selecting the area - if [ -z "$GEOM" ]; then - exit 1 - fi - WHAT="Area" -elif [ "$SUBJECT" = "active" ] ; then - FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') - GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') - APP_ID=$(echo "$FOCUSED" | jq -r '.app_id') - WHAT="$APP_ID window" -elif [ "$SUBJECT" = "screen" ] ; then - GEOM="" - WHAT="Screen" -elif [ "$SUBJECT" = "output" ] ; then - GEOM="" - OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') - WHAT="$OUTPUT" -elif [ "$SUBJECT" = "window" ] ; then - GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) - # Check if user exited slurp without selecting the area - if [ -z "$GEOM" ]; then - exit 1 - fi - WHAT="Window" -else - die "Unknown subject to take a screen shot from" "$SUBJECT" -fi - -if [ "$ACTION" = "copy" ] ; then - takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" - notifyOk "$WHAT copied to buffer" -else - if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then - TITLE="Screenshot of $SUBJECT" - MESSAGE=$(basename "$FILE") - notifyOk "$MESSAGE" "$TITLE" - echo $FILE - else - notifyError "Error taking screenshot with grim" - fi -fi diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index 49154c7..e4ee1e3 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Modified from sway's locking script @@ -8,7 +8,8 @@ if [[ ! $(which swayidle 2> /dev/null) ]]; then exit 1 fi -choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical) +choices=("suspend" "shutdown" "poweroff" "reboot" "lock") +choice=$(printf "%s\n" "${choices[@]}" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical ) if test "$choice" = lock ; then diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index 90dbe5d..3484182 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -10,7 +10,7 @@ else fi sed -i $command ~/.config/kitty/kitty.conf -sed -i $command ~/.config/sway/config.d/theme +sed -i $command ~/.config/sway/conf.d/theme sed -i $command ~/.config/swaync/style.css sed -i $command ~/.config/waybar/style.css sed -i $command ~/.config/wofi/config diff --git a/.zshrc b/.zshrc index f7dd10e..dbbe4bb 100644 --- a/.zshrc +++ b/.zshrc @@ -135,3 +135,6 @@ export MANPATH="${MANPATH}:${HOME}/.local/share/man" #ccache support export USE_CCACHE=1 export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH" + +# ssh-agent +export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket From 3eac1701cac4e90a28c07cafe090ccf571d95724 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 8 Jan 2024 10:29:15 +0800 Subject: [PATCH 27/28] sway keybinds --- .config/sway/conf.d/custom.d/outputs | 23 +++++++++++------------ .config/sway/conf.d/keybinds | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.config/sway/conf.d/custom.d/outputs b/.config/sway/conf.d/custom.d/outputs index c19143f..bcdf3e1 100644 --- a/.config/sway/conf.d/custom.d/outputs +++ b/.config/sway/conf.d/custom.d/outputs @@ -1,11 +1,19 @@ output * adaptive_sync on # 75hz monitor -output 'Lectron Company Ltd LECOO M2412HL GG30A137' mode 2560x1440@74.968Hz -output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb +output 'Lectron Company Ltd LECOO M2412HL GG30A137' mode 2560x1440@75Hz output 'Lectron Company Ltd LECOO M2412HL GG30A137' pos 0 500 +output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb # output 'Lectron Company Ltd LECOO M2412HL GG30A137' max_render_time 5 -output 'Lectron Company Ltd LECOO M2412HL GG30A137' render_bit_depth 10 + +# lab screen +output "XMI Redmi 27 NU 3948622WH08F4" mode --custom 3840x2160@35.000Hz +output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 +output "XMI Redmi 27 NU 3948622WH08F4" transform 90 +output "XMI Redmi 27 NU 3948622WH08F4" pos 2560 0 +output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb +output "XMI Redmi 27 NU 3948622WH08F4" max_render_time 3 +output "XMI Redmi 27 NU 3948622WH08F4" render_bit_depth 10 # laptop screen output 'Thermotrex Corporation TL160ADMP03-0 Unknown' subpixel rgb @@ -18,12 +26,3 @@ output 'Thermotrex Corporation TL160ADMP03-0 Unknown' mode 2560x1600@60.000Hz # TV at home output 'Unknown HUAWEI INC 0x00000000' mode 3840x2160@60.000Hz output 'Unknown HUAWEI INC 0x00000000' scale 2 - -# lab screen -output "XMI Redmi 27 NU 3948622WH08F4" mode --custom 2560x1440@75.000Hz -output "XMI Redmi 27 NU 3948622WH08F4" transform 90 -output "XMI Redmi 27 NU 3948622WH08F4" pos 2560 0 -output "XMI Redmi 27 NU 3948622WH08F4" subpixel rgb -# output "XMI Redmi 27 NU 3948622WH08F4" max_render_time off -# output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 -output "XMI Redmi 27 NU 3948622WH08F4" render_bit_depth 10 diff --git a/.config/sway/conf.d/keybinds b/.config/sway/conf.d/keybinds index 0d651bf..5dbb2d1 100644 --- a/.config/sway/conf.d/keybinds +++ b/.config/sway/conf.d/keybinds @@ -36,7 +36,7 @@ bindsym --whole-window $mod+button9 workspace next # bind fn keys bindsym XF86AudioMicMute exec amixer set Capture toggle exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob -bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob +bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+ && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1| awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $SWAYSOCK.wob bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle && ~/.config/sway/scripts/getmute.sh > $SWAYSOCK.wob bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob From 07c074f9f2e509c522535936a7d7fe9fe7170ec8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 10 Jan 2024 11:38:39 +0800 Subject: [PATCH 28/28] Use adwaita icon --- .config/gtk-2.0/dark.conf | 2 +- .config/gtk-2.0/light.conf | 2 +- .config/mpv/mpv.conf | 16 ---------------- .config/sway/Wallpaper | 1 - .config/sway/conf.d/custom.d/outputs | 2 +- .config/sway/conf.d/display | 4 ---- .config/sway/conf.d/exec | 5 ++--- .config/sway/conf.d/themes/dark | 4 +++- .config/sway/conf.d/themes/light | 4 +++- .config/sway/scripts/themes.sh | 12 +++++++----- .zshrc | 6 ++++-- 11 files changed, 22 insertions(+), 36 deletions(-) delete mode 120000 .config/sway/Wallpaper diff --git a/.config/gtk-2.0/dark.conf b/.config/gtk-2.0/dark.conf index cbd25fc..dfb790a 100644 --- a/.config/gtk-2.0/dark.conf +++ b/.config/gtk-2.0/dark.conf @@ -1,3 +1,3 @@ -gtk-icon-theme-name = "Papirus-Dark" +gtk-icon-theme-name = "Adwaita" gtk-theme-name = "Adwaita-dark" gtk-font-name = "IBM Plex 12" diff --git a/.config/gtk-2.0/light.conf b/.config/gtk-2.0/light.conf index fcd2438..2b62d87 100644 --- a/.config/gtk-2.0/light.conf +++ b/.config/gtk-2.0/light.conf @@ -1,3 +1,3 @@ -gtk-icon-theme-name = "Papirus-Light" +gtk-icon-theme-name = "Adwaita" gtk-theme-name = "Adwaita" gtk-font-name = "IBM Plex 12" diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index faa00c9..2519776 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -1,19 +1,3 @@ volume=70 sub-auto=fuzzy # hwdec=auto-safe - -# mpv options with upscaling - -deband -deband-grain=0 -deband-range=12 -deband-threshold=32 -hwdec=auto-copy -profile=gpu-hq -gpu-api=opengl -fbo-format=rgba16f -dither-depth=auto -dither=fruit -glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/noise_static_luma.hook -glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/noise_static_chroma.hook -glsl-shaders-append=/home/ryan/.config/mpv/default-shader-pack/shaders/CAS-scaled.glsl diff --git a/.config/sway/Wallpaper b/.config/sway/Wallpaper deleted file mode 120000 index 4e640f7..0000000 --- a/.config/sway/Wallpaper +++ /dev/null @@ -1 +0,0 @@ -/home/ryan/Pictures/wall/sway/dark \ No newline at end of file diff --git a/.config/sway/conf.d/custom.d/outputs b/.config/sway/conf.d/custom.d/outputs index bcdf3e1..b46f66d 100644 --- a/.config/sway/conf.d/custom.d/outputs +++ b/.config/sway/conf.d/custom.d/outputs @@ -7,7 +7,7 @@ output 'Lectron Company Ltd LECOO M2412HL GG30A137' subpixel rgb # output 'Lectron Company Ltd LECOO M2412HL GG30A137' max_render_time 5 # lab screen -output "XMI Redmi 27 NU 3948622WH08F4" mode --custom 3840x2160@35.000Hz +output "XMI Redmi 27 NU 3948622WH08F4" mode --custom 2560x1440@60Hz output "XMI Redmi 27 NU 3948622WH08F4" scale 1.5 output "XMI Redmi 27 NU 3948622WH08F4" transform 90 output "XMI Redmi 27 NU 3948622WH08F4" pos 2560 0 diff --git a/.config/sway/conf.d/display b/.config/sway/conf.d/display index b345821..1515b24 100644 --- a/.config/sway/conf.d/display +++ b/.config/sway/conf.d/display @@ -11,7 +11,3 @@ bindswitch --reload --locked lid:off output $laptop enable #workspace_auto_back_and_forth yes force_display_urgency_hint 500 ms smart_borders no_gaps - -# Use static wallpaper - -output * bg $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) fill diff --git a/.config/sway/conf.d/exec b/.config/sway/conf.d/exec index daf3a43..b70e785 100644 --- a/.config/sway/conf.d/exec +++ b/.config/sway/conf.d/exec @@ -5,7 +5,6 @@ exec mkfifo /tmp/kitty exec wlsunset -s 19:00 -S 07:00 -d 1800 exec light -S 70 -# exec gentoo-pipewire-launcher -# exec swaync exec playerctld daemon -# exec dbus-update-activation-environment --all + +include /usr/local/etc/sway/config.d/* diff --git a/.config/sway/conf.d/themes/dark b/.config/sway/conf.d/themes/dark index d6a51d1..eef27ac 100644 --- a/.config/sway/conf.d/themes/dark +++ b/.config/sway/conf.d/themes/dark @@ -5,7 +5,7 @@ set $gnome-schema org.gnome.desktop.interface exec_always { gsettings set $gnome-schema color-scheme 'prefer-dark' gsettings set $gnome-schema gtk-theme 'Adwaita' - gsettings set $gnome-schema icon-theme 'Papirus-Dark' + gsettings set $gnome-schema icon-theme 'Adwaita' gsettings set $gnome-schema cursor-theme 'Adwaita' gsettings set $gnome-schema font-name 'ibm-plex 12' gsettings set org.gtk.Settings.FileChooser startup-mode cwd @@ -22,3 +22,5 @@ client.background #928374 #282828 #borders stuff default_border pixel 1 + +output * bg #282828 solid_color diff --git a/.config/sway/conf.d/themes/light b/.config/sway/conf.d/themes/light index ecf8a6e..9a58c1c 100644 --- a/.config/sway/conf.d/themes/light +++ b/.config/sway/conf.d/themes/light @@ -5,7 +5,7 @@ set $gnome-schema org.gnome.desktop.interface exec_always { gsettings set $gnome-schema color-scheme 'prefer-light' gsettings set $gnome-schema gtk-theme 'Adwaita' - gsettings set $gnome-schema icon-theme 'Papirus-Light' + gsettings set $gnome-schema icon-theme 'Adwaita' gsettings set $gnome-schema cursor-theme 'Adwaita' gsettings set $gnome-schema font-name 'ibm-plex 12' gsettings set org.gtk.Settings.FileChooser startup-mode cwd @@ -22,3 +22,5 @@ client.background #ebdbb2 #fbf1c7 #borders stuff default_border pixel 1 + +output * bg #fbf1c7 solid_color diff --git a/.config/sway/scripts/themes.sh b/.config/sway/scripts/themes.sh index 3484182..7230877 100755 --- a/.config/sway/scripts/themes.sh +++ b/.config/sway/scripts/themes.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash scheme=$(echo -e "light\ndark" | wofi -d -p "󰔎 Select color scheme") # simply subsitude dark and light @@ -29,8 +30,8 @@ if [ $scheme = "light" ]; then # gtk2 cp ~/.config/gtk-2.0/light.conf ~/.gtkrc-2.0 # set wallpaper location - unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/wall/sway/light ~/.config/sway/Wallpaper + # unlink ~/.config/sway/Wallpaper + # ln -s ~/Pictures/wall/sway/light ~/.config/sway/Wallpaper else # kitty config kitty -1 sh -c "kitty @ set-colors -a -c ~/.config/kitty/themes/dark.conf" & @@ -42,8 +43,9 @@ else # gtk2 cp ~/.config/gtk-2.0/dark.conf ~/.gtkrc-2.0 # set dark wallpaper - unlink ~/.config/sway/Wallpaper - ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper + # unlink ~/.config/sway/Wallpaper + # ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper fi -hyprctl reload +swaymsg reload +systemctl --user restart waybar.service diff --git a/.zshrc b/.zshrc index dbbe4bb..6da34ce 100644 --- a/.zshrc +++ b/.zshrc @@ -37,8 +37,10 @@ zinit light zsh-users/zsh-completions zinit light zsh-users/zsh-history-substring-search # Software -zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat" -zinit light sharkdp/bat +if ! command -v bat &> /dev/null ; then + zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat" + zinit light sharkdp/bat +fi zinit from"gh-r" as"program" mv"direnv* -> direnv" \ atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \