update config file

This commit is contained in:
lostecho
2023-07-12 15:41:39 +08:00
parent 4cbe664a8d
commit ec395e9a08
27 changed files with 715 additions and 453 deletions

View File

@@ -0,0 +1,52 @@
# Environment Variables
# see https://wiki.hyprland.org/Configuring/Environment-variables/
# Theming Related Variables
# Set cursor size. See FAQ below for why you might want this variable set.
# https://wiki.hyprland.org/FAQ/
env = XCURSOR_SIZE,24
# Set a GTK theme manually, for those who want to avoid appearance tools such as lxappearance or nwg-look
#env = GTK_THEME,
# Set your cursor theme. The theme needs to be installed and readable by your user.
#env = XCURSOR_THEME,
# the line below may help with multiple monitors
#env = WLR_EGL_NO_MODIFIERS,1
#XDG Specifications
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
# Toolkit Backend Variables
# GTK: Use wayland if available, fall back to x11 if not.
#env = GDK_BACKEND,wayland,x11
# QT: Use wayland if available, fall back to x11 if not.
#env = QT_QPA_PLATFORM,wayland,xcb
# Run SDL2 applications on Wayland. Remove or set to x11 if games that
# provide older versions of SDL cause compatibility issues
#env = SDL_VIDEODRIVER,wayland
# Clutter package already has wayland enabled, this variable
#will force Clutter applications to try and use the Wayland backend
#env = CLUTTER_BACKEND,wayland
# QT Variables
# (From the QT documentation) enables automatic scaling, based on the monitors pixel density
# https://doc.qt.io/qt-5/highdpi.html
#env = QT_AUTO_SCREEN_SCALE_FACTOR,1
# Tell QT applications to use the Wayland backend, and fall back to x11 if Wayland is unavailable
#env = QT_QPA_PLATFORM,wayland,xcb
# Disables window decorations on QT applications
#env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
#Tells QT based applications to pick your theme from qt5ct, use with Kvantum.
#env = QT_QPA_PLATFORMTHEME,qt5ct

View File

@@ -20,26 +20,28 @@ monitor=DP-2,2560x1440@75,0x0,1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = ~/.config/hypr/scripts/xdg-portal-hyprland # hyprland init parameter
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # Wayland magic (screen sharing etc.)
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # More wayland magic (screen sharing etc.)
exec-once = ~/.config/hypr/scripts/bgaction # swww wallpaper
exec-once = ~/.local/share/hyprload/hyprload.sh
#exec = ~/.config/HyprV/hyprv_util setbg
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = waybar # status bar
exec-once = dunst # notification daemon
exec-once = fcitx --replace -d # input method
# exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # Wayland magic (screen sharing etc.)
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # More wayland magic (screen sharing etc.)
exec-once = ~/.config/hypr/scripts/xdg-portal-hyprland # hyprland init parameter
# exec-once = cliphist wipe # clear clipboard
exec-once = /usr/lib/polkit-kde-authentication-agent-1 # root certifaction
exec-once = ~/.config/hypr/scripts/bgaction # swww wallpaper
# exec-once = wl-paste --type text --watch cliphist store
# exec-once = wl-paste --type image --watch cliphist store
# exec-once = hyprpaper # wallpaper
# exec-once = ~/.config/hypr/scripts/launch_bar # status bar
# exec-once = nm-applet --indicator # Systray app for Network/Wifi
exec-once = blueman-applet
exec-once = nm-applet --indicator # Systray app for Network/Wifi
exec-once = fcitx5 --replace -d # input method
exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store
exec-once = cliphist wipe # clear clipboard
exec-once = udiskie &
exec-once = $HOME/.local/share/hyprload/hyprload.sh
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
#source = ~/.config/hypr/env_var.conf
source = ~/.config/hypr/media-binds.conf
# Some default env vars.
env = XCURSOR_SIZE,24
@@ -138,6 +140,9 @@ gestures {
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic mouse V1 {
#sensitivity = -0.5
}
device:apple-inc.-magic-trackpad-1 {
#scroll_factor = 1.0
#middle_button_emulation=0
@@ -153,12 +158,11 @@ windowrulev2 = opacity 1.0 1.0, class:^(Google-chrome)$
windowrulev2 = animation popin,class:^(Google-chrome)$
windowrulev2 = opacity 0.8 0.9,class:^(kitty)$
windowrulev2 = animation popin,class:^(kitty)$,title:^(update-sys)$
# windowrulev2 = animation popin,class:^(thunar)$
# windowrulev2 = opacity 0.8 0.8,class:^(thunar)$
windowrulev2 = animation slide,class:^(wofi)$
windowrulev2 = move 100%-433 53,class:^(wofi)$,title:^(clippick)$
windowrulev2 = opacity 0.8 0.8,class:^(VSCodium)$
windowrulev2 = opacity 0.8 1.0,class:^(obsidian)$
windowrulev2 = tile,title:^(微信读书)
windowrulev2 = tile,title:^(微信读书)$
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
@@ -168,7 +172,6 @@ $mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, kitty
bind = $mainMod, R, exec, pkill wofi; wofi --show drun
# bind = $mainMod, E, exec, kitty ranger
bind = $mainMod, E, exec, dolphin
bind = $mainMod, O, exec, obsidian
bind = $mainMod, P, exec, logseq
@@ -183,7 +186,7 @@ bind = $mainMod, W, exec, google-chrome-stable --profile-directory=Default --app
# bind = $mainMod, Y, exec, grim -g "$(slurp)" $screen_file
# bind = $mainMod SHIFT, Y, exec, grim - | wl-copy
bind = $mainMod, F, togglefloating,
bind = $mainMod SHIFT, P, pseudo, # dwindle
bind = $mainMod SHIFT, I, pseudo, # dwindle
bind = $mainMod SHIFT, J, togglesplit, # dwindle
bind = $mainMod, Space, fullscreen
@@ -223,8 +226,15 @@ bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod SHIFT, mouse:272, resizewindow
bindm = $mainMod, mouse:273, resizewindow
# Brightness control
binde = $mainMod SHIFT, P, exec, brightnessctl set 5%+
binde = $mainMod SHIFT, O, exec, brightnessctl set 5%-
binde = $mainMod SHIFT, L, exec, ddcutil setvcp 10 + 10
binde = $mainMod SHIFT, K, exec, ddcutil setvcp 10 - 10
#binde = $mainMod SHIFT, L, exec, brightnessctl set 5%+
#binde = $mainMod SHIFT, K, exec, brightnessctl set 5%-
# Sound control
binde = $mainMod SHIFT, O, exec, pamixer -d 5
binde = $mainMod SHIFT, P, exec, pamixer -i 5

145
dotfiles/config/hypr/hyprv_util Executable file
View File

@@ -0,0 +1,145 @@
#!/bin/bash
. ~/.config/HyprV/hyprv.conf
get_theme() {
# Check which waybar theme is set
THEMEIS=$(readlink -f ~/.config/waybar/style.css | cut -d '-' -f3)
#if the theme is not dark then we need to switch to it
if [[ $THEMEIS == "dark.css" ]]; then
SWITCHTO="-dark"
MODESTR="Dark"
else
SWITCHTO=""
MODESTR="Light"
fi
}
update_theme() {
#set the xfce and GTK theme
if [[ $VER == "v4" || $VERTO == "v4-" ]]; then
xfconf-query -c xsettings -p /Net/IconThemeName -s "Papirus-Dark"
gsettings set org.gnome.desktop.interface icon-theme "Papirus-Dark"
else
xfconf-query -c xsettings -p /Net/IconThemeName -s "Adwaita$SWITCHTO"
gsettings set org.gnome.desktop.interface icon-theme "Adwaita$SWITCHTO"
fi
xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita$SWITCHTO"
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita$SWITCHTO"
}
get_ver() {
VER=$(readlink -f ~/.config/waybar/config.jsonc | cut -d '-' -f1 | cut -d '/' -f8)
}
restart_waybar() {
#restart the waybar
pkill waybar
waybar &
get_ver
if [[ $VER == "v4" ]]; then
waybar --config ~/.config/HyprV/waybar/conf/v4-config-bottom.jsonc
fi
}
set_current_background() {
get_theme
get_ver
if [[ ! -z "$SET_BG" ]]; then
#set the current background
if [[ $THEMEIS == "dark.css" ]]; then
swww img ~/.config/HyprV/backgrounds/$VER'-background-dark.jpg'
else
swww img ~/.config/HyprV/backgrounds/$VER'-background.jpg'
fi
else
swww img $SET_BG
fi
}
switch_version() {
get_theme
get_ver
case $VER in
v1)
#we are on v1 so switch to v2
VERTO="v2-"
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "switching to HyprV2"
;;
v2)
#we are on v2 so switch to v3
VERTO="v3-"
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "switching to HyprV3"
;;
v3)
#we are on v3 so switch to v4
VERTO="v4-"
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "switching to HyprV4"
;;
v4)
#we are on v4 so switch to v1
VERTO="v1-"
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low "switching to HyprV1"
;;
esac
#set the waybar config
ln -sf ~/.config/HyprV/waybar/conf/$VERTO'config.jsonc' ~/.config/waybar/config.jsonc
#set the waybar theme
ln -sf ~/.config/HyprV/waybar/style/$VERTO'style'$SWITCHTO.css ~/.config/waybar/style.css
#set the wofi theme
ln -sf ~/.config/HyprV/wofi/style/$VERTO'style'$SWITCHTO.css ~/.config/wofi/style.css
#set the background
if [ -z $SET_BG ]; then
swww img ~/.config/HyprV/backgrounds/$VERTO'background'$SWITCHTO.jpg --transition-fps 60 --transition-type wipe --transition-duration 2
else
swww img $SET_BG --transition-fps 60 --transition-type wipe --transition-duration 2
fi
#update the sddm image
cp -f ~/.config/HyprV/backgrounds/$VERTO'background'$SWITCHTO.jpg /usr/share/sddm/themes/sdt/wallpaper.jpg
}
switch_keyboard() {
hyprctl switchxkblayout $SET_KB next
}
if [[ "$1" == "vswitch" ]]; then
switch_version
update_theme
restart_waybar
elif [[ "$1" == "setbg" ]]; then
set_current_background
update_theme
restart_waybar
elif [[ "$1" == "swkb" ]]; then
switch_keyboard
restart_waybar
fi
# need to show the version and tooltip
get_ver
TOOLTIP='Default Keybinds\n'\
'SUPER + Q = Start Kitty\n'\
'SUPER + F4 = Close Window\n'\
'SUPER + L = Lock Screen\n'\
'SUPER + M = Logout menu\n'\
'SUPER + E = File Manager\n'\
'SUPER + V = Toggle Float\n'\
'SUPER + SPACE = App Launcher\n'\
'SUPER + S = Screenshot\n'\
'SUPER + T = Switch HyprV version\n'\
'ALT + V = Open clipboard manager'
echo '{"text": "'$VER'", "tooltip": "'$TOOLTIP'"}'

View File

@@ -0,0 +1,12 @@
$SCRIPT = ~/.config/HyprV/waybar/scripts
bind = , xf86audioraisevolume, exec, $SCRIPT/volume --inc
bind = , xf86audiolowervolume, exec, $SCRIPT/volume --dec
bind = , xf86AudioMicMute, exec, $SCRIPT/volume --toggle-mic
bind = , xf86audioMute, exec, $SCRIPT/volume --toggle
bind = , xf86KbdBrightnessDown, exec, $SCRIPT/kb-brightness --dec
bind = , xf86KbdBrightnessUp, exec, $SCRIPT/kb-brightness --inc
bind = , xf86MonBrightnessDown, exec, $SCRIPT/brightness --dec
bind = , xf86MonBrightnessUp, exec, $SCRIPT/brightness --inc