updates
No files matched your search
@@ -11,10 +11,8 @@ env = XDG_CURRENT_DESKTOP,Hyprland
|
||||
env = XDG_SESSION_DESKTOP,Hyprland
|
||||
env = XDG_SESSION_TYPE,wayland
|
||||
|
||||
# xwayland apps scale fix (useful if you are use monitor scaling)
|
||||
# see https://wiki.hyprland.org/Configuring/XWayland/
|
||||
# toolkit-specific scale
|
||||
# env = GDK_SCALE,2
|
||||
env = SDL_VIDEODRIVEVER=wayland
|
||||
env = GDK_SCALE,2
|
||||
|
||||
# vulkan
|
||||
#env = WLR_RENDERER,vulkan
|
||||
@@ -23,7 +21,8 @@ env = XDG_SESSION_TYPE,wayland
|
||||
env = MOZ_ENABLE_WAYLAND,1 firefox
|
||||
|
||||
# electron >28 apps (may help)
|
||||
env = ELECTRON_OZONE_PLATFORM_HINT,auto
|
||||
env = ELECTRON_ENABLE_WAYLAND, 1
|
||||
env = ELECTRON_OZONE_PLATFORM_HINT,wayland
|
||||
|
||||
# Cursor size
|
||||
env = XCURSOR_SIZE,1
|
||||
env = XCURSOR_SIZE,6
|
||||
@@ -8,12 +8,6 @@ $RunCMD = $scriptsDir/RunCMD.sh
|
||||
$UserConfigs = $HOME/dotfiles/hypr/UserConfigs
|
||||
|
||||
#VolumeControl
|
||||
#bindle = ,XF86MonBrightnessUp, exec, $RunCMD brightness --inc
|
||||
#bindle = ,XF86MonBrightnessDown, exec, $RunCMD brightness --dec
|
||||
#bindle = ,XF86AudioRaiseVolume, exec, $RunCMD volume --inc
|
||||
#bindle = ,XF86AudioLowerVolume, exec, $RunCMD volume --dec
|
||||
#bindle = ,XF86AudioMute, exec, $RunCMD volume --toggle
|
||||
#bindle = ,XF86AudioMicMute, exec, $RunCMD volume --toggle-mic
|
||||
bind = ,XF86MonBrightnessUp, exec, brightnessctl set +5%
|
||||
bind = ,XF86MonBrightnessDown, exec, brightnessctl set 5%-
|
||||
bind = ,XF86AudioRaiseVolume, exec, pamixer -i 5 # Volume Higher key
|
||||
@@ -28,9 +22,6 @@ bind = ,XF86AudioStop, exec, playerctl pause
|
||||
# Laptops Other Key
|
||||
bind = , xf86Sleep, exec, systemctl suspend # sleep button
|
||||
|
||||
# Disable Toucpad
|
||||
bind = $mainMod_SHIFT, D, exec, $RunCMD touchpad # Disable Touchpad
|
||||
|
||||
# Below are useful when you are connecting your laptop in external display
|
||||
# Suggest you edit below for your laptop display
|
||||
# From WIKI This is to disable laptop monitor when lid is closed.
|
||||
|
||||
@@ -18,34 +18,28 @@ exec-once = dbus-update-activation-environment --systemd --all
|
||||
exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME
|
||||
|
||||
# Polkit (Polkit Gnome / KDE)
|
||||
exec-once = $RunCMD polkit_
|
||||
exec-once = $scriptsDir/Polkit.sh
|
||||
|
||||
# Battery Notification
|
||||
exec-once = $RunCMD battery_notify
|
||||
exec-once = $scriptsDir/Battery_Notify.sh
|
||||
|
||||
# starup apps
|
||||
#exec-once = waybar &
|
||||
exec-once = ags &
|
||||
exec-once = wl-gammarelay-rs &
|
||||
#exec-once = swaync &
|
||||
exec-once = blueman-applet &
|
||||
exec-once = nm-applet --indicator &
|
||||
exec-once = hypridle &
|
||||
exec-once = udiskie &
|
||||
exec-once = devify &
|
||||
exec-once = pypr &
|
||||
exec-once = swayosd-server &
|
||||
#exec-once = blueman-applet &
|
||||
exec-once = bluetoothctl power off &
|
||||
|
||||
exec-once = hyprctl setcursor Bibata-Original-Classic 6
|
||||
|
||||
# clipboard manager
|
||||
exec-once = wl-paste --type text --watch cliphist store
|
||||
exec-once = wl-paste --type image --watch cliphist store
|
||||
|
||||
# Rainbow borders
|
||||
#exec-once = $RunCMD rainbow_border
|
||||
|
||||
# Here are list of features available but disabled by default
|
||||
#exec-once = swww query || swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/wall-08.png # persistent wallpaper
|
||||
|
||||
@@ -13,9 +13,9 @@ $RunCMD = $scriptsDir/RunCMD.sh
|
||||
|
||||
# RunCMD App launcher
|
||||
#bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window -config ~/.config/rofi/launcher.rasi
|
||||
bind = $mainMod, D, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window
|
||||
bind = CTRL, mouse:273, exec, killall rofi || rofi -show drun
|
||||
bind = ALT, C, exec, pkill rofi || $scriptsDir/Xmenu.sh
|
||||
#bind = $mainMod, D, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window
|
||||
#bind = CTRL, mouse:273, exec, killall rofi || rofi -show drun
|
||||
bind = $mainMod, D, exec, pkill rofi || true && ags -t applauncher
|
||||
|
||||
# Terminals
|
||||
bind = ALT_SHIFT,Return, exec, kitty --title Kitty --single-instance
|
||||
@@ -29,20 +29,20 @@ bind = $mainMod, Slash, exec, pypr toggle nvim && hyprctl dispatch bringactiv
|
||||
|
||||
|
||||
# FEATURES / EXTRAS
|
||||
bind = SHIFT_ALT, R, exec, $RunCMD reload_all
|
||||
bind = $mainMod_SHIFT, G, exec, $RunCMD gamemode
|
||||
bind = $mainMod, PERIOD, exec, $RunCMD emoji
|
||||
bind = $mainMod, PERIOD, exec, $scriptsDir/RofiEmoji.sh
|
||||
bind = ALT, F3, exec, $RunCMD kb_changer
|
||||
bind = $mainMod_SHIFT, B, exec, $RunCMD toggle_blur
|
||||
bind = $mainMod, space, exec, $RunCMD change_layout
|
||||
bind = SHIFT_ALT, C, exec, pkill rofi || true && ags -t cliphist
|
||||
bind = SHIFT_ALT, E, exec, $RunCMD edit
|
||||
bind = $mainMod, W, exec, $RunCMD select_wall
|
||||
bind = SHIFT_ALT,W, exec, $RunCMD random_wall
|
||||
bind = $mainMod_SHIFT, W, exec, $RunCMD apply_wallpaper_effects
|
||||
bind = $mainMod, W, exec, ags -r "OpenSettings('wallpaper')"
|
||||
bind = SHIFT_ALT,W, exec, python -O $scriptsDir/wallpaper.py -R
|
||||
bind = $mainMod, F1, exec, $scriptsDir/KeyHints.sh
|
||||
bind = $mainMod, COMMA, exec, pypr zoom
|
||||
bind = ALT, COMMA, exec, pypr zoom +1
|
||||
bind = $mainMod_SHIFT, Z, exec, ags -t media
|
||||
bind = $mainMod, R, exec, ags -t sidebar
|
||||
|
||||
|
||||
# Online Music related keybinds
|
||||
bind = ALT, M, exec, $RunCMD music -m # open rofi music
|
||||
@@ -52,7 +52,7 @@ bind = ALT, P, exec, $RunCMD music -p # Previous
|
||||
bind = ALT, R, exec, $RunCMD music -k # Resume
|
||||
|
||||
# ScreenShot
|
||||
bind = $mainMod, Z, exec, $RunCMD screenshot --area
|
||||
bind = ,Print, exec, $RunCMD screenshot --now
|
||||
bind = $mainMod, Z, exec, $scriptsDir/ScreenShot.sh --area
|
||||
bind = ,Print, exec, $scriptsDir/ScreenShot.sh --now
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ dwindle {
|
||||
}
|
||||
|
||||
master {
|
||||
new_is_master=1
|
||||
new_status = master
|
||||
new_on_top=1
|
||||
mfact = 0.5
|
||||
}
|
||||
@@ -22,31 +22,30 @@ general {
|
||||
apply_sens_to_raw = 1
|
||||
gaps_in = 2
|
||||
gaps_out = 1
|
||||
border_size = 2
|
||||
border_size = 0
|
||||
resize_on_border = true
|
||||
|
||||
col.active_border = rgba(DB4740FF)
|
||||
col.inactive_border = rgba(1B1D1DFF)
|
||||
col.active_border = rgb({#bdacc9.strip})
|
||||
col.inactive_border = rgb({#bdacc9.darken(10).strip})
|
||||
|
||||
layout = master
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding = 4
|
||||
rounding = 6
|
||||
|
||||
active_opacity = 1.0
|
||||
active_opacity = 1
|
||||
inactive_opacity = 0.9
|
||||
fullscreen_opacity = 1.0
|
||||
fullscreen_opacity = 1
|
||||
|
||||
dim_inactive = true
|
||||
dim_strength = 0.1
|
||||
dim_special = 0.8
|
||||
|
||||
drop_shadow = true
|
||||
shadow_range = 6
|
||||
shadow_render_power = 1
|
||||
col.shadow = rgba(0, 0, 0, 0.5)
|
||||
col.shadow_inactive = 0x50000000
|
||||
shadow_range = 10
|
||||
shadow_render_power = 3
|
||||
col.shadow = 0x66000000
|
||||
|
||||
blur {
|
||||
enabled = true
|
||||
@@ -59,13 +58,38 @@ decoration {
|
||||
|
||||
animations {
|
||||
enabled = true
|
||||
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
|
||||
animation = windows, 1, 7, myBezier
|
||||
animation = windowsOut, 1, 7, default, popin 80%
|
||||
# Animation curves
|
||||
|
||||
bezier = linear, 0, 0, 1, 1
|
||||
bezier = md3_standard, 0.2, 0, 0, 1
|
||||
bezier = md3_decel, 0.05, 0.7, 0.1, 1
|
||||
bezier = md3_accel, 0.3, 0, 0.8, 0.15
|
||||
bezier = overshot, 0.05, 0.9, 0.1, 1.1
|
||||
bezier = crazyshot, 0.1, 1.5, 0.76, 0.92
|
||||
bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0
|
||||
bezier = menu_decel, 0.1, 1, 0, 1
|
||||
bezier = menu_accel, 0.38, 0.04, 1, 0.07
|
||||
bezier = easeInOutCirc, 0.85, 0, 0.15, 1
|
||||
bezier = easeOutCirc, 0, 0.55, 0.45, 1
|
||||
bezier = easeOutExpo, 0.16, 1, 0.3, 1
|
||||
bezier = softAcDecel, 0.26, 0.26, 0.15, 1
|
||||
bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration
|
||||
# Animation configs
|
||||
animation = windows, 1, 3, md3_decel, popin 60%
|
||||
animation = windowsIn, 1, 3, md3_decel, popin 60%
|
||||
animation = windowsOut, 1, 3, md3_accel, popin 60%
|
||||
animation = border, 1, 10, default
|
||||
animation = borderangle, 1, 8, default
|
||||
animation = fade, 1, 7, default
|
||||
animation = workspaces, 1, 9, default
|
||||
animation = fade, 1, 3, md3_decel
|
||||
animation = layers, 1, 2, md3_decel, slide
|
||||
animation = layersIn, 1, 3, menu_decel, slide
|
||||
animation = layersOut, 1, 1.6, menu_accel
|
||||
animation = fadeLayersIn, 1, 2, menu_decel
|
||||
animation = fadeLayersOut, 1, 4.5, menu_accel
|
||||
animation = workspaces, 1, 7, menu_decel, slide
|
||||
# animation = workspaces, 1, 2.5, softAcDecel, slide
|
||||
# animation = workspaces, 1, 7, menu_decel, slidefade 15%
|
||||
# animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15%
|
||||
animation = specialWorkspace, 1, 3, md3_decel, slidevert
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +137,13 @@ misc {
|
||||
enable_swallow = true
|
||||
no_direct_scanout = true #for fullscreen games
|
||||
focus_on_activate = false
|
||||
swallow_regex = ^(kitty)$
|
||||
swallow_regex = (foot|kitty|allacritty|Alacritty)
|
||||
#disable_autoreload = true
|
||||
|
||||
initial_workspace_tracking = false
|
||||
animate_manual_resizes = false
|
||||
animate_mouse_windowdragging = false
|
||||
new_window_takes_over_fullscreen = 2
|
||||
}
|
||||
|
||||
binds {
|
||||
@@ -129,6 +158,6 @@ xwayland {
|
||||
}
|
||||
|
||||
# cursor section for Hyprland v0.41.0 or newer
|
||||
#cursor {
|
||||
# enable_hyprcursor = true
|
||||
#}
|
||||
cursor {
|
||||
enable_hyprcursor = true
|
||||
}
|
||||
@@ -8,11 +8,17 @@ windowrulev2 = opacity 0.9 0.9, class:^(geany)$
|
||||
windowrulev2 = opacity 0.80 0.70,class:^(nm-applet)$
|
||||
windowrulev2 = opacity 0.80 0.70,class:^(nm-connection-editor)$
|
||||
|
||||
#windowrulev2 = bordercolor rgb(ff5555),xwayland:1
|
||||
# Xwaylandvideobridge (if installed)
|
||||
windowrulev2 = opacity 0.0 override,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noblur,class:^(xwaylandvideobridge)$
|
||||
|
||||
# Workspace Rules
|
||||
windowrule = workspace 5, ^(.*vlc*)$
|
||||
|
||||
windowrule = float, ^(com.github.Aylur.ags)$
|
||||
|
||||
# MPV
|
||||
windowrule = workspace 5, ^(.*mpv*)$
|
||||
@@ -190,3 +196,15 @@ windowrulev2 = center, title:(File Operation Progress)
|
||||
|
||||
|
||||
|
||||
# Layer Rules
|
||||
layerrule = noanim, hyprpicker
|
||||
|
||||
layerrule = noanim, noanim
|
||||
layerrule = blur, gtk-layer-shell
|
||||
layerrule = ignorezero, gtk-layer-shell
|
||||
layerrule = blur, launcher
|
||||
layerrule = ignorealpha 0.5, launcher
|
||||
layerrule = blur, notifications
|
||||
layerrule = ignorealpha 0.69, notifications
|
||||
|
||||
layerrule = noanim, notifications
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 512 512" xml:space="preserve">
|
||||
<g>
|
||||
<path style="fill:#F2D23D;" d="M256.007,423.724c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31
|
||||
C229.517,500.143,241.374,512,256,512c0.004,0,0.004,0,0.007,0c14.622-0.004,26.476-11.859,26.476-26.483v-35.31
|
||||
C282.483,435.583,270.629,423.728,256.007,423.724z"/>
|
||||
<path style="fill:#F2D23D;" d="M256.007,0c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31
|
||||
c0,14.626,11.857,26.483,26.483,26.483c0.004,0,0.004,0,0.007,0c14.622-0.004,26.476-11.859,26.476-26.483v-35.31
|
||||
C282.483,11.859,270.629,0.004,256.007,0z"/>
|
||||
<path style="fill:#F2D23D;" d="M256.007,141.241h-0.004c-63.276,0-114.755,51.481-114.755,114.759s51.479,114.759,114.755,114.759
|
||||
h0.004c63.278-0.002,114.759-51.481,114.759-114.759C370.766,192.724,319.285,141.243,256.007,141.241z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#EEBF00;" d="M256.004,141.241c-63.276,0-114.755,51.481-114.755,114.76c0,63.278,51.479,114.757,114.755,114.757
|
||||
h0.004V141.241H256.004z"/>
|
||||
<path style="fill:#EEBF00;" d="M256.007,88.276V0c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31
|
||||
c0,14.626,11.857,26.483,26.483,26.483C256.004,88.276,256.004,88.276,256.007,88.276z"/>
|
||||
<path style="fill:#EEBF00;" d="M256,423.724c-14.626,0-26.483,11.857-26.483,26.483v35.31C229.517,500.143,241.374,512,256,512
|
||||
c0.004,0,0.004,0,0.007,0v-88.276C256.004,423.724,256.004,423.724,256,423.724z"/>
|
||||
</g>
|
||||
<path style="fill:#F2D23D;" d="M423.724,256c0,14.626,11.857,26.483,26.483,26.483h35.31C500.143,282.483,512,270.626,512,256
|
||||
c0-14.626-11.857-26.483-26.483-26.483h-35.31C435.581,229.517,423.724,241.374,423.724,256z"/>
|
||||
<path style="fill:#EEBF00;" d="M26.483,282.483h35.31c14.626,0,26.483-11.857,26.483-26.483c0-14.626-11.857-26.483-26.483-26.483
|
||||
h-35.31C11.857,229.517,0,241.374,0,256C0,270.626,11.857,282.483,26.483,282.483z"/>
|
||||
<path style="fill:#F2D23D;" d="M399.567,74.98l-24.97,24.968c-10.342,10.342-10.342,27.11,0,37.452
|
||||
c5.171,5.171,11.949,7.758,18.725,7.758s13.556-2.586,18.725-7.756l24.97-24.968c10.342-10.342,10.342-27.11,0-37.452
|
||||
C426.68,64.637,409.911,64.637,399.567,74.98z"/>
|
||||
<path style="fill:#EEBF00;" d="M99.949,374.597l-24.968,24.968c-10.342,10.342-10.342,27.109,0,37.452
|
||||
c5.171,5.171,11.949,7.756,18.725,7.756s13.556-2.586,18.725-7.756l24.97-24.968c10.342-10.342,10.342-27.11,0-37.452
|
||||
C127.061,364.256,110.292,364.254,99.949,374.597z"/>
|
||||
<path style="fill:#F2D23D;" d="M399.567,437.018c5.171,5.171,11.949,7.756,18.725,7.756c6.778,0,13.556-2.585,18.727-7.756
|
||||
c10.342-10.342,10.342-27.11,0-37.452l-24.97-24.968c-10.341-10.341-27.11-10.341-37.452,0.002
|
||||
c-10.342,10.342-10.342,27.109,0,37.452L399.567,437.018z"/>
|
||||
<path style="fill:#EEBF00;" d="M99.949,137.401c5.171,5.171,11.949,7.756,18.727,7.756c6.778,0,13.556-2.586,18.725-7.758
|
||||
c10.342-10.342,10.342-27.11,0-37.452L112.433,74.98c-10.341-10.341-27.11-10.341-37.452,0c-10.342,10.342-10.342,27.11,0,37.452
|
||||
L99.949,137.401z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB |
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 512 512" xml:space="preserve">
|
||||
<circle style="fill:#A5EB78;" cx="256.005" cy="256.005" r="247.556"/>
|
||||
<path style="opacity:0.1;enable-background:new ;" d="M53.508,289.795c0-136.719,110.832-247.551,247.551-247.551
|
||||
c45.567,0,88.25,12.325,124.92,33.802C381.637,34.146,321.823,8.449,256,8.449C119.281,8.449,8.449,119.281,8.449,256
|
||||
c0,91.152,49.273,170.784,122.631,213.748C83.318,424.618,53.508,360.691,53.508,289.795z"/>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M391.375,234.761L366.4,94.714l-35.529,35.529c-22.076-13.136-47.765-20.559-74.872-20.559
|
||||
c-36.924,0-72.186,13.795-99.289,38.842c-26.941,24.899-43.46,58.683-46.514,95.13l67.354,5.644
|
||||
c1.64-19.572,10.53-37.733,25.035-51.137c14.577-13.473,33.547-20.892,53.414-20.892c8.352,0,16.447,1.322,24.075,3.767
|
||||
l-28.749,28.749L391.375,234.761z"/>
|
||||
<path style="fill:#FFFFFF;" d="M110.197,277.238l24.975,140.049l35.529-35.529c22.076,13.136,47.765,20.559,74.872,20.559
|
||||
c36.924,0,72.186-13.795,99.289-38.842c26.941-24.899,43.46-58.683,46.514-95.13l-67.354-5.644
|
||||
c-1.64,19.572-10.53,37.733-25.035,51.137c-14.577,13.473-33.547,20.892-53.414,20.892c-8.352,0-16.447-1.323-24.075-3.767
|
||||
l28.749-28.749L110.197,277.238z"/>
|
||||
</g>
|
||||
<path d="M256,512c-68.38,0-132.667-26.629-181.019-74.981C26.629,388.667,0,324.38,0,256c0-75.008,32.755-145.994,89.866-194.758
|
||||
c3.548-3.029,8.881-2.61,11.911,0.938c3.03,3.548,2.609,8.881-0.938,11.911C47.493,119.642,16.897,185.943,16.897,256
|
||||
c0,131.841,107.261,239.103,239.103,239.103c55.438,0,109.469-19.406,152.142-54.641c3.597-2.972,8.923-2.463,11.895,1.135
|
||||
c2.971,3.598,2.462,8.923-1.135,11.895C373.208,491.221,315.356,512,256,512z"/>
|
||||
<path d="M438.06,432.164c-2.047,0-4.099-0.739-5.724-2.236c-3.431-3.163-3.649-8.507-0.487-11.938
|
||||
c40.789-44.256,63.252-101.784,63.252-161.989C495.103,124.159,387.841,16.897,256,16.897c-45.761,0-90.232,12.968-128.607,37.501
|
||||
c-3.929,2.513-9.155,1.364-11.668-2.567s-1.364-9.155,2.567-11.668C159.389,13.887,207.008,0,256,0
|
||||
c68.38,0,132.667,26.629,181.019,74.981S512,187.62,512,256c0,64.461-24.053,126.056-67.725,173.441
|
||||
C442.61,431.248,440.338,432.164,438.06,432.164z"/>
|
||||
<path d="M177.56,257.748c-0.237,0-0.474-0.01-0.714-0.03l-67.354-5.644c-4.65-0.39-8.104-4.474-7.714-9.125
|
||||
c3.231-38.557,20.703-74.295,49.198-100.63c28.669-26.496,65.968-41.087,105.023-41.087c25.686,0,50.937,6.375,73.441,18.491
|
||||
l30.985-30.985c2.226-2.225,5.502-3.028,8.507-2.086c3.003,0.944,5.232,3.479,5.784,6.576l24.975,140.049
|
||||
c0.486,2.719-0.39,5.504-2.343,7.457c-1.952,1.953-4.737,2.831-7.457,2.343l-140.049-24.975c-3.098-0.552-5.632-2.781-6.576-5.784
|
||||
c-0.943-3.003-0.14-6.281,2.086-8.507l17.735-17.735c-2.351-0.238-4.717-0.357-7.088-0.357c-17.736,0-34.67,6.623-47.681,18.648
|
||||
c-12.949,11.967-20.886,28.174-22.349,45.637C185.599,254.415,181.906,257.748,177.56,257.748z M119.58,235.963l50.667,4.246
|
||||
c3.373-18.447,12.638-35.343,26.605-48.251c16.143-14.919,37.149-23.136,59.149-23.136c9.049,0,18.016,1.402,26.653,4.169
|
||||
c2.805,0.899,4.94,3.194,5.634,6.056s-0.154,5.88-2.237,7.963l-17.299,17.299l112.181,20.005l-20.006-112.18l-24.08,24.08
|
||||
c-2.732,2.734-6.971,3.263-10.295,1.286c-21.296-12.673-45.692-19.371-70.55-19.371c-34.791,0-68.017,12.997-93.554,36.598
|
||||
C139.142,176.268,124.114,204.857,119.58,235.963z"/>
|
||||
<path d="M135.171,425.735c-0.846,0-1.7-0.127-2.532-0.389c-3.003-0.944-5.233-3.479-5.785-6.576L101.88,278.721
|
||||
c-0.486-2.719,0.39-5.504,2.343-7.457c1.952-1.953,4.736-2.832,7.457-2.343l140.049,24.975c3.098,0.552,5.632,2.781,6.576,5.784
|
||||
c0.943,3.003,0.14,6.281-2.086,8.507l-17.735,17.735c2.351,0.238,4.717,0.357,7.088,0.357c17.736,0,34.67-6.623,47.681-18.648
|
||||
c12.949-11.967,20.886-28.174,22.349-45.637c0.39-4.649,4.477-8.101,9.125-7.713l67.354,5.644c4.65,0.39,8.104,4.474,7.714,9.125
|
||||
c-3.231,38.557-20.702,74.295-49.198,100.63c-28.669,26.496-65.968,41.087-105.023,41.087c-25.686,0-50.937-6.375-73.441-18.491
|
||||
l-30.985,30.985C139.537,424.87,137.379,425.735,135.171,425.735z M120.642,287.682l20.005,112.181l24.08-24.08
|
||||
c2.733-2.734,6.972-3.261,10.295-1.286c21.296,12.673,45.692,19.371,70.551,19.371c34.791,0,68.017-12.997,93.554-36.598
|
||||
c23.305-21.537,38.332-50.127,42.866-81.234l-50.667-4.246c-3.373,18.447-12.638,35.343-26.605,48.251
|
||||
c-16.142,14.919-37.149,23.136-59.149,23.136c-9.049,0-18.016-1.402-26.653-4.169c-2.805-0.899-4.94-3.194-5.634-6.056
|
||||
c-0.694-2.862,0.154-5.88,2.237-7.963l17.299-17.299L120.642,287.682z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
PREV_STATUS="Unknown" # Initialize previous status
|
||||
FULL_CHARGE_NOTIFIED=0
|
||||
LOW_BATTERY_NOTIFIED=0
|
||||
|
||||
while true; do
|
||||
STATUS=$(cat /sys/class/power_supply/AC/online 2>/dev/null) # Get charger status using power supply directory
|
||||
|
||||
if [ "$STATUS" != "$PREV_STATUS" ]; then # Check if the charger status has changed
|
||||
FULL_CHARGE_NOTIFIED=0 # Reset full charge notification state when charger status changes
|
||||
LOW_BATTERY_NOTIFIED=0 # Reset low battery notification state when charger status changes
|
||||
PREV_STATUS="$STATUS" # Update previous status
|
||||
fi
|
||||
|
||||
# Get battery percentage and remaining time using acpi
|
||||
BATTERY_INFO=$(acpi)
|
||||
PERCENT=$(echo "$BATTERY_INFO" | awk -F ',|%' '{print $2}')
|
||||
|
||||
if [ "$STATUS" == "1" ] && [ "$PERCENT" -eq 100 ] && [ "$FULL_CHARGE_NOTIFIED" -eq 0 ]; then # Check if the battery is charging and the percentage is 100%
|
||||
notify-send -u low "🔌 Battery Fully Charged" "You can unplug the charger" # Send a notification when the battery is fully charged
|
||||
FULL_CHARGE_NOTIFIED=1 # Set the state to indicate that the full charge notification has been sent
|
||||
fi
|
||||
|
||||
if [ "$PERCENT" -le 40 ] && [ "$LOW_BATTERY_NOTIFIED" -eq 0 ]; then # Check if the battery percentage is less than or equal to 20% and low battery notification has not been sent
|
||||
notify-send -u critical "🪫 Low Battery" "Plug in the charger" # Send low battery notification
|
||||
LOW_BATTERY_NOTIFIED=1 # Set the state to indicate that the low battery notification has been sent
|
||||
fi
|
||||
sleep 0.1 # Sleep for some time before checking again
|
||||
done
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Toggle wifi state #
|
||||
# #
|
||||
######################################
|
||||
|
||||
toggle_wifi() {
|
||||
wifi_status=$(nmcli radio wifi)
|
||||
if [ "$wifi_status" == "enabled" ]; then
|
||||
nmcli radio wifi off
|
||||
notify-send -u low -i "$notif" 'Airplane mode: OFF'
|
||||
else
|
||||
nmcli radio wifi on
|
||||
notify-send -u low -i "$notif" 'Airplane mode: ON'
|
||||
fi
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Toggle bluetooth state #
|
||||
# #
|
||||
######################################
|
||||
|
||||
toggle_bluetooth() {
|
||||
if [ "$bluetooth_status" == "no" ]; then
|
||||
bluetoothctl power on
|
||||
notify-send -u low -i "$notif" 'Bluetooth ON'
|
||||
else
|
||||
bluetoothctl power off
|
||||
notify-send -u low -i "$notif" 'Bluetooth OFF'
|
||||
fi
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Enable/Disable Monitor #
|
||||
# #
|
||||
######################################
|
||||
|
||||
disable_edp1() {
|
||||
enable_edp1
|
||||
sleep 1
|
||||
hyprctl keyword monitor eDP-1,disable
|
||||
}
|
||||
enable_edp1() {
|
||||
hyprctl keyword monitor eDP-1,preferred,auto,1
|
||||
}
|
||||
|
||||
@@ -48,8 +48,12 @@ yad --width=$dynamic_width --height=$dynamic_height \
|
||||
" W" "Choose wallpaper" "(Wallpaper Menu)" \
|
||||
" Shift W" "Choose wallpaper effects" "(imagemagick + swww)" \
|
||||
"SHIFT ALT W" "Random wallpaper" "(via swww)" \
|
||||
" H" "Hide/UnHide Waybar" "waybar" \
|
||||
" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \
|
||||
" Print" "screenshot" "(grim)" \
|
||||
" Z" "screenshot region" "(grim + slurp)" \
|
||||
"CTRL ALT P" "power-menu" "(wlogout)" \
|
||||
"CTRL ALT L" "screen lock" "(hyprlock)" \
|
||||
"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \
|
||||
" SHIFT Space" "Fullscreen" "Toggles to full screen" \
|
||||
" Space" "Toggle Dwindle | Master Layout" "Hyprland Layout" \
|
||||
|
||||
@@ -61,15 +61,7 @@ play_local_music() {
|
||||
notification "$choice"
|
||||
|
||||
# For some reason wont start playlist at 0
|
||||
if [[ $i -eq 0 ]]; then
|
||||
# Play the selected local music file using mpv
|
||||
mpv --loop-playlist --vid=no "$mDIR"
|
||||
|
||||
else
|
||||
file=$i
|
||||
# Play the selected local music file using mpv
|
||||
mpv --playlist-start="$file" --loop-playlist --vid=no "$mDIR"
|
||||
fi
|
||||
mpv --playlist-start="$i" --loop-playlist --vid=no "${local_music[@]}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This is for polkits, it will start from top and will stop if the top is executed
|
||||
|
||||
# Polkit possible paths files to check
|
||||
polkit=(
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
"/usr/lib/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-gnome-authentication-agent-1"
|
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
||||
)
|
||||
|
||||
executed=false # Flag to track if a file has been executed
|
||||
|
||||
# Loop through the list of files
|
||||
for file in "${polkit[@]}"; do
|
||||
if [ -e "$file" ]; then
|
||||
echo "File $file found, executing command..."
|
||||
exec "$file"
|
||||
executed=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# If none of the files were found, you can add a fallback command here
|
||||
if [ "$executed" == false ]; then
|
||||
echo "None of the specified files were found. Install a Polkit"
|
||||
fi
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# For Notification icon
|
||||
notif="$HOME/dotfiles/hypr/assets/bell.png"
|
||||
reload="$HOME/dotfiles/hypr/assets/reload.svg"
|
||||
|
||||
# Scripts DIR
|
||||
SCRIPTSDIR="$HOME/dotfiles/hypr/scripts"
|
||||
UserSCRIPTSDIR="$HOME/dotfiles/hypr/UserScripts"
|
||||
|
||||
|
||||
# For Random Wallpaper
|
||||
wallDIR="$HOME/Pictures/wallpapers"
|
||||
FPS=60
|
||||
TYPE="random"
|
||||
DURATION=1
|
||||
BEZIER=".43,1.19,1,.4"
|
||||
SWWW_PARAMS="--transition-fps ${FPS} --transition-type ${TYPE} --transition-duration ${DURATION} --transition-bezier ${BEZIER}"
|
||||
|
||||
# For Select Wallpaper
|
||||
FPS1=30
|
||||
TYPE1="wipe"
|
||||
DURATION1=1
|
||||
BEZIER1=".43,1.19,1,.4"
|
||||
SWWW_PARAMS1="--transition-fps $FPS1 --transition-type $TYPE1 --transition-duration $DURATION1 --transition-bezier ${BEZIER1}"
|
||||
|
||||
|
||||
# For Keyboard Layout Switcher
|
||||
layout_f="$HOME/.cache/kb_layout"
|
||||
settings_file="$HOME/dotfiles/hypr/UserConfigs/UserSettings.conf"
|
||||
|
||||
|
||||
# For Quickedit
|
||||
configs="$HOME/dotfiles/hypr/configs"
|
||||
UserConfigs="$HOME/dotfiles/hypr/UserConfigs"
|
||||
|
||||
iDIR="$HOME/dotfiles/hypr/assets"
|
||||
|
||||
RunCMD="$SCRIPTSDIR/RunCMD.sh"
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Quick Edit #
|
||||
# #
|
||||
######################################
|
||||
|
||||
edit() {
|
||||
menu() {
|
||||
options=("Env-variables" "Window-Rules" "Startup_Apps" "User-Keybinds" "Monitors" "Laptop-Keybinds" "User-Settings" )
|
||||
for ((i = 0; i < ${#options[@]}; i++)); do
|
||||
printf "%d. view %s\n" "$((i + 1))" "${options[i]}"
|
||||
done
|
||||
}
|
||||
main() {
|
||||
options=("ENVariables.conf" "WindowRules.conf" "Startup_Apps.conf" "UserKeybinds.conf" "Monitors.conf" "Laptops.conf" "UserSettings.conf" )
|
||||
choice=$(menu | rofi -dmenu -i -p " View / Edit Hyprland Configs:" | cut -d. -f1)
|
||||
[[ $choice =~ ^[1-7]$ ]] && kitty -e nvim "$UserConfigs/${options[choice - 1]}"
|
||||
}
|
||||
main
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Keybinds #
|
||||
# #
|
||||
######################################
|
||||
|
||||
keybind() {
|
||||
CONFIG=$(fd --base-directory "$HOME/dotfiles/keyb/bindings" --type f . | rofi -dmenu -p "Keybinds" -config ~/dotfiles/rofi/config-long.rasi)
|
||||
|
||||
hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$HOME/dotfiles/keyb/bindings/$CONFIG'"
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Emoji #
|
||||
# #
|
||||
######################################
|
||||
|
||||
emoji() {
|
||||
A="$(rofi -dmenu -p "Emoji:" -config ~/dotfiles/rofi/config-long.rasi < "$HOME/dotfiles/hypr/configs/emojis" | cut -d ' ' -f 1 | tr -d '\n')"
|
||||
[[ -n "$A" ]] && wl-copy -- "$A"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ~/dotfiles/hypr/scripts/Ui_cmd.sh
|
||||
source ~/dotfiles/hypr/scripts/Device_cmd.sh
|
||||
source ~/dotfiles/hypr/scripts/Rofi_cmd.sh
|
||||
source ~/dotfiles/hypr/scripts/System_cmd.sh
|
||||
source ~/dotfiles/hypr/scripts/Music_cmd.sh
|
||||
source ~/dotfiles/hypr/scripts/Util.sh
|
||||
|
||||
|
||||
help() {
|
||||
declare -F
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Screenshots scripts
|
||||
iDIR="$HOME/dotfiles/hypr/assets"
|
||||
|
||||
notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/screenshot.svg"
|
||||
dir="$(xdg-user-dir PICTURES)/Screenshots"
|
||||
[[ ! -d "$dir" ]] && mkdir -p "$dir"
|
||||
|
||||
notify_view() {
|
||||
local msg="Screenshot Saved."
|
||||
if [[ "$1" == "active" && ! -e "$active_window_path" ]]; then
|
||||
msg="Screenshot NOT Saved."
|
||||
fi
|
||||
$notify_cmd_shot "$msg"
|
||||
}
|
||||
|
||||
countdown() {
|
||||
for ((sec=$1; sec>0; sec--)); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR/timer.png" "Taking shot in: $sec"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
take_shot() {
|
||||
local time=$(date "+%d-%b_%H-%M-%S")
|
||||
local file="Screenshot_${time}_${RANDOM}.png"
|
||||
cd "$dir" && grim - | tee "$file" | wl-copy
|
||||
sleep 2
|
||||
notify_view "$1"
|
||||
}
|
||||
|
||||
shot_timer() {
|
||||
local time=$(date "+%d-%b_%H-%M-%S")
|
||||
local file="Screenshot_${time}_${RANDOM}.png"
|
||||
countdown "$1"
|
||||
sleep 1
|
||||
take_shot "$2"
|
||||
}
|
||||
|
||||
shotarea() {
|
||||
local time=$(date "+%d-%b_%H-%M-%S")
|
||||
local tmpfile=$(mktemp)
|
||||
local area=$(slurp)
|
||||
if [[ -z "$area" ]]; then
|
||||
notify-send -u low -i "$iDIR/picture.png" 'No area selected'
|
||||
rm "$tmpfile"
|
||||
return
|
||||
fi
|
||||
grim -g "$area" - > "$tmpfile" && [[ -s "$tmpfile" ]] && {
|
||||
wl-copy < "$tmpfile"
|
||||
mv "$tmpfile" "$dir/Screenshot_${time}_${RANDOM}.png"
|
||||
notify_view
|
||||
}
|
||||
rm "$tmpfile"
|
||||
}
|
||||
|
||||
shotactive() {
|
||||
local time=$(date "+%d-%b_%H-%M-%S")
|
||||
local active_window_path="${dir}/Screenshot_${time}_$(hyprctl -j activewindow | jq -r '.class').png"
|
||||
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "$active_window_path"
|
||||
sleep 1
|
||||
notify_view "active"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--now) take_shot ;;
|
||||
--in5) shot_timer 5 ;;
|
||||
--in10) shot_timer 10 ;;
|
||||
--area) shotarea ;;
|
||||
--active) shotactive ;;
|
||||
*) echo "Available Options: --now --in5 --in10 --area --active" ;;
|
||||
esac
|
||||
@@ -1,288 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Rofi Option for Xmenu #
|
||||
# #
|
||||
######################################
|
||||
|
||||
_confirm_rofi() {
|
||||
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 250px;}' \
|
||||
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
|
||||
-theme-str 'listview {columns: 2; lines: 1;}' \
|
||||
-theme-str 'element-text {horizontal-align: 0.5;}' \
|
||||
-theme-str 'textbox {horizontal-align: 0.5;}' \
|
||||
-kb-accept-entry 'Return,space' \
|
||||
-dmenu \
|
||||
-mesg "$1"
|
||||
|
||||
}
|
||||
_need_confirm() {
|
||||
local _result="$(echo -e "No\nYes" | _confirm_rofi "$1")"
|
||||
if [[ "$_result" == "Yes" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Power & Reboot #
|
||||
# #
|
||||
######################################
|
||||
|
||||
sys_reboot() {
|
||||
if _need_confirm "Reboot system?"; then
|
||||
reboot
|
||||
fi
|
||||
}
|
||||
sys_poweroff() {
|
||||
if _need_confirm "Shutdown system?"; then
|
||||
poweroff
|
||||
fi
|
||||
}
|
||||
sys_lock() {
|
||||
if _need_confirm "Lock screen?"; then
|
||||
pidof hyprlock || hyprlock -q
|
||||
fi
|
||||
}
|
||||
sys_logout() {
|
||||
if _need_confirm "Logout?"; then
|
||||
loginctl kill-session $XDG_SESSION_ID
|
||||
fi
|
||||
}
|
||||
sys_suspend() {
|
||||
if _need_confirm "Suspend system?"; then
|
||||
systemctl suspend
|
||||
fi
|
||||
}
|
||||
sys_hibernate() {
|
||||
if _need_confirm "Hibernate system?"; then
|
||||
systemctl hibernate
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################################
|
||||
# #
|
||||
# Reload ags rofi #
|
||||
# #
|
||||
#######################################################
|
||||
# (SHIFT ALT R)
|
||||
reload_all() {
|
||||
file_exists() {
|
||||
[ -e "$1" ]
|
||||
}
|
||||
|
||||
processes=("ags" "rofi")
|
||||
|
||||
for process in "${processes[@]}"; do
|
||||
pid=$(pidof "$process")
|
||||
if [ -n "$pid" ]; then
|
||||
pkill "$process"
|
||||
fi
|
||||
done
|
||||
# quit ags
|
||||
ags -q
|
||||
sleep 0.3
|
||||
ags &
|
||||
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Reload Hyprland #
|
||||
# #
|
||||
######################################
|
||||
|
||||
reload_hypr() {
|
||||
hyprctl reload
|
||||
notify-send -u low -i $reload 'Reload Hyprland'
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Battery Notifer #
|
||||
# #
|
||||
######################################
|
||||
|
||||
battery_notify() {
|
||||
PREV_STATUS="Unknown" # Initialize previous status
|
||||
FULL_CHARGE_NOTIFIED=0
|
||||
LOW_BATTERY_NOTIFIED=0
|
||||
|
||||
while true; do
|
||||
STATUS=$(cat /sys/class/power_supply/AC/online 2>/dev/null) # Get charger status using power supply directory
|
||||
|
||||
if [ "$STATUS" != "$PREV_STATUS" ]; then # Check if the charger status has changed
|
||||
FULL_CHARGE_NOTIFIED=0 # Reset full charge notification state when charger status changes
|
||||
LOW_BATTERY_NOTIFIED=0 # Reset low battery notification state when charger status changes
|
||||
PREV_STATUS="$STATUS" # Update previous status
|
||||
fi
|
||||
|
||||
# Get battery percentage and remaining time using acpi
|
||||
BATTERY_INFO=$(acpi)
|
||||
PERCENT=$(echo "$BATTERY_INFO" | awk -F ',|%' '{print $2}')
|
||||
|
||||
if [ "$STATUS" == "1" ] && [ "$PERCENT" -eq 100 ] && [ "$FULL_CHARGE_NOTIFIED" -eq 0 ]; then # Check if the battery is charging and the percentage is 100%
|
||||
notify-send -u low "🔌 Battery Fully Charged" "You can unplug the charger" # Send a notification when the battery is fully charged
|
||||
FULL_CHARGE_NOTIFIED=1 # Set the state to indicate that the full charge notification has been sent
|
||||
fi
|
||||
|
||||
if [ "$PERCENT" -le 40 ] && [ "$LOW_BATTERY_NOTIFIED" -eq 0 ]; then # Check if the battery percentage is less than or equal to 20% and low battery notification has not been sent
|
||||
notify-send -u critical "🪫 Low Battery" "Plug in the charger" # Send low battery notification
|
||||
LOW_BATTERY_NOTIFIED=1 # Set the state to indicate that the low battery notification has been sent
|
||||
fi
|
||||
sleep 0.1 # Sleep for some time before checking again
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Polkit #
|
||||
# #
|
||||
######################################
|
||||
|
||||
polkit_(){
|
||||
polkit=(
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
"/usr/lib/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-gnome-authentication-agent-1"
|
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
||||
)
|
||||
executed=false # Flag to track if a file has been executed
|
||||
# Loop through the list of files
|
||||
for file in "${polkit[@]}"; do
|
||||
if [ -e "$file" ]; then
|
||||
echo "File $file found, executing command..."
|
||||
exec "$file"
|
||||
executed=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
# If none of the files were found, you can add a fallback command here
|
||||
if [ "$executed" == false ]; then
|
||||
echo "None of the specified files were found. Install a Polkit"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# SymLink #
|
||||
# #
|
||||
######################################
|
||||
|
||||
symlink() {
|
||||
# Define cache directory
|
||||
cache_dir="$HOME/.cache/swww/"
|
||||
|
||||
# Get a list of monitor outputs
|
||||
monitor_outputs=($(ls "$cache_dir"))
|
||||
|
||||
# Initialize variables
|
||||
ln_success=false
|
||||
current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
echo $current_monitor
|
||||
cache_file="$cache_dir$current_monitor"
|
||||
echo $cache_file
|
||||
|
||||
if [ -f "$cache_file" ]; then
|
||||
# Read wallpaper path from cache file
|
||||
wallpaper_path=$(cat "$cache_file")
|
||||
echo $wallpaper_path
|
||||
|
||||
# Symlink wallpaper to the location accessible by Rofi
|
||||
if ln -sf "$wallpaper_path" "$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_current"; then
|
||||
ln_success=true # Set the flag to true upon successful execution
|
||||
fi
|
||||
|
||||
# Copy the wallpaper for wallpaper effects (optional)
|
||||
# cp -r "$wallpaper_path" "$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
|
||||
fi
|
||||
|
||||
# Check if symlink was successful
|
||||
if [ "$ln_success" = true ]; then
|
||||
echo 'Symlink successful'
|
||||
fi
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Wallpaper Effect #
|
||||
# #
|
||||
######################################
|
||||
|
||||
|
||||
apply_wallpaper_effects() {
|
||||
current_wallpaper="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_current"
|
||||
wallpaper_output="$HOME/dotfiles/hypr/wallpaper_effects/.wallpaper_modified"
|
||||
focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
iDIR="$HOME/dotfiles/hypr/assets/"
|
||||
SWWW_PARAMS="--transition-fps 60 --transition-type wipe --transition-duration 2"
|
||||
|
||||
declare -A effects=(
|
||||
["Black & White"]="magick $current_wallpaper -colorspace gray -sigmoidal-contrast 10,40% $wallpaper_output"
|
||||
["Blurred"]="magick $current_wallpaper -blur 0x5 $wallpaper_output"
|
||||
["Solarize"]="magick $current_wallpaper -solarize 80% $wallpaper_output"
|
||||
["Sepia Tone"]="magick $current_wallpaper -sepia-tone 65% $wallpaper_output"
|
||||
["Negate"]="magick $current_wallpaper -negate $wallpaper_output"
|
||||
["Charcoal"]="magick $current_wallpaper -charcoal 0x5 $wallpaper_output"
|
||||
["Edge Detect"]="magick $current_wallpaper -edge 1 $wallpaper_output"
|
||||
["Emboss"]="magick $current_wallpaper -emboss 0x5 $wallpaper_output"
|
||||
["Sharpen"]="magick $current_wallpaper -sharpen 0x5 $wallpaper_output"
|
||||
["Oil Paint"]="magick $current_wallpaper -paint 4 $wallpaper_output"
|
||||
["Vignette"]="magick $current_wallpaper -vignette 0x5 $wallpaper_output"
|
||||
["Posterize"]="magick $current_wallpaper -posterize 4 $wallpaper_output"
|
||||
["Polaroid"]="magick $current_wallpaper -polaroid 0 $wallpaper_output"
|
||||
["No Effects"]="no-effects"
|
||||
)
|
||||
|
||||
no_effects() {
|
||||
swww img -o "$focused_monitor" "$current_wallpaper" $SWWW_PARAMS &
|
||||
wait $!
|
||||
notify-send -u low -i "$iDIR/bell.png" "No wallpaper effects"
|
||||
cp $current_wallpaper $wallpaper_output
|
||||
}
|
||||
|
||||
main() {
|
||||
options="No Effects"
|
||||
for effect in "${!effects[@]}"; do
|
||||
if [ "$effect" != "No Effects" ]; then
|
||||
options+="\n$effect"
|
||||
fi
|
||||
done
|
||||
|
||||
choice=$(echo -e "$options" | rofi -i -dmenu)
|
||||
if [[ -n "$choice" && "${effects[$choice]+exists}" ]]; then
|
||||
if [ "$choice" == "No Effects" ]; then
|
||||
no_effects
|
||||
else
|
||||
notify-send -u normal -i "$iDIR/bell.png" "Applying $choice effects"
|
||||
eval "${effects[$choice]}"
|
||||
sleep 1
|
||||
swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS &
|
||||
wait $!
|
||||
notify-send -u low -i "$iDIR/bell.png" "$choice effects applied"
|
||||
fi
|
||||
else
|
||||
echo "Effects not recognized."
|
||||
fi
|
||||
}
|
||||
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
notif="$HOME/dotfiles/hypr/assets/bell.png"
|
||||
|
||||
|
||||
|
||||
# For Keyboard Layout Switcher
|
||||
|
||||
|
||||
######################################
|
||||
@@ -43,22 +45,6 @@ toggle_animation() {
|
||||
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Rainbow Border #
|
||||
# #
|
||||
######################################
|
||||
|
||||
rainbow_border() {
|
||||
function random_hex() {
|
||||
random_hex=("0xff$(openssl rand -hex 3)")
|
||||
echo $random_hex
|
||||
}
|
||||
hyprctl keyword general:col.active_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg
|
||||
|
||||
hyprctl keyword general:col.inactive_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg
|
||||
}
|
||||
|
||||
################################################
|
||||
# #
|
||||
# Change Layout Master to Dwindle #
|
||||
@@ -91,23 +77,6 @@ change_layout() {
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Random Wallpaper #
|
||||
# #
|
||||
######################################
|
||||
|
||||
random_wall() {
|
||||
focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
|
||||
PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \)))
|
||||
RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
|
||||
|
||||
swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS
|
||||
$RunCMD symlink
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Auto Wallpaper Changer #
|
||||
@@ -115,6 +84,12 @@ $RunCMD symlink
|
||||
######################################
|
||||
|
||||
auto_wall() {
|
||||
wallDIR="$HOME/Pictures/wallpapers"
|
||||
FPS=60
|
||||
TYPE="random"
|
||||
DURATION=1
|
||||
BEZIER=".43,1.19,1,.4"
|
||||
SWWW_PARAMS="--transition-fps ${FPS} --transition-type ${TYPE} --transition-duration ${DURATION} --transition-bezier ${BEZIER}"
|
||||
focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
INTERVAL=1800 # This controls (in seconds) when to switch to the next image
|
||||
while true; do
|
||||
@@ -126,38 +101,6 @@ auto_wall() {
|
||||
done
|
||||
}
|
||||
|
||||
######################################
|
||||
# #
|
||||
# Wallpaper Selector #
|
||||
# #
|
||||
######################################
|
||||
|
||||
select_wall() {
|
||||
focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
build_theme() {
|
||||
rows="$1"
|
||||
cols="$2"
|
||||
icon_size="$2"
|
||||
echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:${icon_size}.0000em;}listview{lines:${rows};columns:${cols};}"
|
||||
}
|
||||
if [ ! -d "$wallDIR" ]; then
|
||||
echo "Error: Wallpaper directory not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
images=$(find "$wallDIR" -maxdepth 1 -type f -printf "%f\x00icon\x1f$wallDIR/%f\n" | sort -n)
|
||||
choice=$(echo -en "$images\nRandom Choice" | rofi -dmenu -i -show-icons -theme-str "$(build_theme 3 5 6)" -p " Wallpaper")
|
||||
if [ -n "$choice" ]; then
|
||||
if [ "$choice" = "Random Choice" ]; then
|
||||
choice=$(find "$wallDIR" -type f -maxdepth 1 -printf "%f\n" | shuf -n1)
|
||||
fi
|
||||
wallpaper="$wallDIR/${choice#*icon\x1f}"
|
||||
swww img -o $focused_monitor $SWWW_PARAMS1 "$wallpaper"
|
||||
$RunCMD symlink
|
||||
else
|
||||
echo "No wallpaper selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
######################################
|
||||
@@ -199,6 +142,8 @@ disable_opaque() {
|
||||
######################################
|
||||
|
||||
kb_changer() {
|
||||
layout_f="$HOME/.cache/kb_layout"
|
||||
settings_file="$HOME/dotfiles/hypr/UserConfigs/UserSettings.conf"
|
||||
current_layout=$(cat "$layout_f")
|
||||
|
||||
[ -f "$settings_file" ] && IFS=',' read -ra layout_mapping <<< "$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2)"
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
brightness() {
|
||||
local notification_timeout=1000
|
||||
|
||||
get_backlight() {
|
||||
brightnessctl -m | cut -d, -f4
|
||||
}
|
||||
|
||||
get_icon() {
|
||||
local current=$(get_backlight | sed 's/%//')
|
||||
echo "$iDIR/brightness.svg"
|
||||
}
|
||||
|
||||
notify_user() {
|
||||
local current=$(get_backlight | sed 's/%//')
|
||||
local icon=$(get_icon)
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%"
|
||||
}
|
||||
|
||||
change_backlight() {
|
||||
brightnessctl set "$1" && notify_user
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--get) get_backlight ;;
|
||||
--inc) change_backlight "+5%" ;;
|
||||
--dec) change_backlight "5%-" ;;
|
||||
*) get_backlight ;;
|
||||
esac
|
||||
}
|
||||
|
||||
volume() {
|
||||
get_volume() {
|
||||
local volume=$(pamixer --get-volume)
|
||||
[[ "$volume" -eq "0" ]] && echo "Muted" || echo "$volume%"
|
||||
}
|
||||
|
||||
get_icon() {
|
||||
local current=$(get_volume)
|
||||
if [[ "$current" == "Muted" ]]; then
|
||||
echo "$iDIR/volume-mute.png"
|
||||
elif [[ "${current%\%}" -le 30 ]]; then
|
||||
echo "$iDIR/volume-low.png"
|
||||
elif [[ "${current%\%}" -le 60 ]]; then
|
||||
echo "$iDIR/volume-mid.png"
|
||||
else
|
||||
echo "$iDIR/volume-high.png"
|
||||
fi
|
||||
}
|
||||
|
||||
notify_user() {
|
||||
local volume=$(get_volume)
|
||||
local icon=$(get_icon)
|
||||
if [[ "$volume" == "Muted" ]]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Volume: Muted"
|
||||
else
|
||||
notify-send -e -h int:value:"${volume%\%}" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Volume: $volume"
|
||||
fi
|
||||
}
|
||||
|
||||
change_volume() {
|
||||
pamixer "$1" "$2" && notify_user
|
||||
}
|
||||
|
||||
toggle_mute() {
|
||||
if [ "$(pamixer --get-mute)" == "false" ]; then
|
||||
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON"
|
||||
fi
|
||||
}
|
||||
|
||||
toggle_mic() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
|
||||
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
|
||||
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
|
||||
fi
|
||||
}
|
||||
|
||||
notify_mic_user() {
|
||||
local volume=$(pamixer --default-source --get-volume)
|
||||
local icon=$(pamixer --default-source --get-mute && echo "$iDIR/microphone-mute.png" || echo "$iDIR/microphone.png")
|
||||
notify-send -e -h int:value:"$volume" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$icon" "Mic-Level: $volume%"
|
||||
}
|
||||
|
||||
change_mic_volume() {
|
||||
pamixer --default-source "$1" "$2" && notify_mic_user
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--get) get_volume ;;
|
||||
--inc) change_volume -i 5 ;;
|
||||
--dec) change_volume -d 5 ;;
|
||||
--toggle) toggle_mute ;;
|
||||
--toggle-mic) toggle_mic ;;
|
||||
--mic-inc) change_mic_volume -i 5 ;;
|
||||
--mic-dec) change_mic_volume -d 5 ;;
|
||||
*) get_volume ;;
|
||||
esac
|
||||
}
|
||||
|
||||
screenshot() {
|
||||
local notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/screenshot.svg"
|
||||
local time=$(date "+%d-%b_%H-%M-%S")
|
||||
local dir="$(xdg-user-dir)/Pictures/Screenshots"
|
||||
local file="Screenshot_${time}_${RANDOM}.png"
|
||||
local active_window_path="${dir}/Screenshot_${time}_$(hyprctl -j activewindow | jq -r '.class').png"
|
||||
|
||||
notify_view() {
|
||||
local msg="Screenshot Saved."
|
||||
[[ "$1" == "active" && ! -e "$active_window_path" ]] && msg="Screenshot NOT Saved."
|
||||
$notify_cmd_shot "$msg"
|
||||
}
|
||||
|
||||
countdown() {
|
||||
for ((sec=$1; sec>0; sec--)); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR/timer.png" "Taking shot in: $sec"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
take_shot() {
|
||||
cd "$dir" && grim - | tee "$file" | wl-copy
|
||||
sleep 2
|
||||
notify_view "$1"
|
||||
}
|
||||
|
||||
shot_timer() {
|
||||
countdown "$1"
|
||||
sleep 1
|
||||
take_shot "$2"
|
||||
}
|
||||
|
||||
shotarea() {
|
||||
local tmpfile=$(mktemp)
|
||||
local area=$(slurp)
|
||||
[[ -z "$area" ]] && { notify-send -u low -i "$iDIR/picture.png" 'No area selected'; rm "$tmpfile"; return; }
|
||||
grim -g "$area" - > "$tmpfile" && [[ -s "$tmpfile" ]] && {
|
||||
wl-copy < "$tmpfile"
|
||||
mv "$tmpfile" "$dir/Screenshot_$(date '+%d-%b_%H-%M-%S')_${RANDOM}.png"
|
||||
notify_view
|
||||
}
|
||||
rm "$tmpfile"
|
||||
}
|
||||
|
||||
shotactive() {
|
||||
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "$active_window_path"
|
||||
sleep 1
|
||||
notify_view "active"
|
||||
}
|
||||
|
||||
[[ ! -d "$dir" ]] && mkdir -p "$dir"
|
||||
|
||||
case "$1" in
|
||||
--now) take_shot ;;
|
||||
--in5) shot_timer 5 ;;
|
||||
--in10) shot_timer 10 ;;
|
||||
--area) shotarea ;;
|
||||
--active) shotactive ;;
|
||||
*) echo "Available Options: --now --in5 --in10 --area --active" ;;
|
||||
esac
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source the configuration file.
|
||||
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
# Note: You can add more options below with the following format:
|
||||
# ["TITLE"]="link"
|
||||
|
||||
# Define menu options as an associative array
|
||||
declare -A menu_options=(
|
||||
|
||||
#hypr
|
||||
["hpr Reload hyprland"]="$RunCMD reload_hypr"
|
||||
["rld Reload All"]="$RunCMD reload_all"
|
||||
["cl ChangeLayout"]="$RunCMD change_layout"
|
||||
["gm GameMode"]="$RunCMD gamemode"
|
||||
["bl ChangeBlur"]="$RunCMD toggle_blur"
|
||||
["flt Float all window"]="hyprctl dispatch workspaceopt allfloat"
|
||||
["hpa Toggle hyprland animation"]="$RunCMD toggle_animation"
|
||||
["op1 enable_opaque"]="$RunCMD enable_opaque"
|
||||
["op0 disable_opaque"]="$RunCMD disable_opaque"
|
||||
#wallpaper
|
||||
["ws Wallpaper Select"]="$RunCMD select_wall"
|
||||
["wc Random Wallpaper"]="$RunCMD random_wall"
|
||||
#RunCMD
|
||||
["; Launcher"]="rofi -show drun -modi drun,filebrowser,run,window"
|
||||
["cb Clipboard"]="pkill rofi || true && ags -t cliphist"
|
||||
["rm Music"]="$RunCMD music -m"
|
||||
["emj Emoji"]="$RunCMD emoji"
|
||||
["kb Kebinds"]="$SCRIPTSDIR/KeyHints.sh"
|
||||
["qe QuickEdits"]="$RunCMD edit"
|
||||
#System
|
||||
["qq Shutdown"]="$RunCMD sys_poweroff"
|
||||
["rr Reboot"]="$RunCMD sys_reboot"
|
||||
["lk Lock"]="$RunCMD sys_lock"
|
||||
["lo LogOut"]="$RunCMD sys_logout"
|
||||
["sp Suspend"]="$RunCMD sys_suspend"
|
||||
["hb Hibernate"]="$RunCMD sys_hibernate"
|
||||
["dm0 disable monitor"]="$RunCMD disable_edp1"
|
||||
["dm1 enable monitor"]="$RunCMD enable_edp1"
|
||||
["tbt Bluetooth"]="$RunCMD toggle_bluetooth"
|
||||
["tw Wifi"]="$RunCMD totggle_wifi"
|
||||
["kb Keyboard switcher"]="$RunCMD kb_changer"
|
||||
#Misc
|
||||
["ff Firefox"]="firefox"
|
||||
["ffp Firefox"]="firefox --private-window"
|
||||
["vi Nvim"]="pypr toggle nvim"
|
||||
["yz Yazi"]="pypr toggle yazi"
|
||||
["tg Telegram"]="telegram-desktop"
|
||||
)
|
||||
|
||||
# Main function
|
||||
main() {
|
||||
choice=$(
|
||||
printf "%s\n" "${!menu_options[@]}" |
|
||||
rofi -dmenu \
|
||||
-p "Rofi" \
|
||||
-mesg "Hello" \
|
||||
-max-history-size 0 \
|
||||
-auto-select
|
||||
|
||||
|
||||
)
|
||||
|
||||
if [ -z "$choice" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
link="${menu_options[$choice]}"
|
||||
$link
|
||||
}
|
||||
|
||||
main
|
||||
@@ -0,0 +1,156 @@
|
||||
import os
|
||||
import sys
|
||||
import importlib.util
|
||||
import argparse
|
||||
import fcntl
|
||||
import subprocess
|
||||
import asyncio
|
||||
import random as _random
|
||||
|
||||
|
||||
lock_file_path = '/tmp/wallpaper.lock'
|
||||
|
||||
|
||||
def acquire_lock():
|
||||
global lock_file
|
||||
lock_file = open(lock_file_path, 'w')
|
||||
try:
|
||||
fcntl.flock(lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
lock_file.write(str(os.getpid()))
|
||||
lock_file.flush()
|
||||
except IOError:
|
||||
print("Another instance of the script is already running.")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def release_lock():
|
||||
fcntl.flock(lock_file, fcntl.LOCK_UN)
|
||||
lock_file.close()
|
||||
os.remove(lock_file_path)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('-I', '--image', type=str, help="Image")
|
||||
group.add_argument('-R', '--random', help="Random image from folder", action='store_true')
|
||||
parser.add_argument('-n', '--notify', help="Send notifications", action='store_true')
|
||||
parser.add_argument('--status', type=str, help="Status file", default="/tmp/wallpaper.status")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
random = args.random
|
||||
image = args.image
|
||||
notify = args.notify
|
||||
status = args.status
|
||||
|
||||
HOME = os.path.expanduser("~")
|
||||
|
||||
|
||||
cache_file = f"{HOME}/.cache/current_wallpaper"
|
||||
square = f"{HOME}/.cache/square_wallpaper.png"
|
||||
|
||||
|
||||
def current_state(state_str: str):
|
||||
with open(status, 'w') as f:
|
||||
f.write(state_str)
|
||||
|
||||
|
||||
def send_notify(label: str, desc: str):
|
||||
if not notify:
|
||||
return
|
||||
subprocess.run(["notify-send", label, desc])
|
||||
|
||||
|
||||
def state(name: str | None, label: str | None, desc: str | None):
|
||||
if name is not None:
|
||||
current_state(name)
|
||||
if label is not None:
|
||||
send_notify(label, desc or "")
|
||||
|
||||
|
||||
def join(*args):
|
||||
return os.path.join(*args)
|
||||
|
||||
|
||||
async def main():
|
||||
state("init", None, None)
|
||||
|
||||
new_wallpaper = f"{HOME}/Pictures/wallpapers/wall-01.jpg"
|
||||
|
||||
if random:
|
||||
files = [f for f in os.listdir(f"{HOME}/Pictures/wallpapers") if f.endswith(('.png', '.jpg', '.jpeg'))]
|
||||
if files:
|
||||
new_wallpaper = join(f"{HOME}/Pictures/wallpapers", _random.choice(files))
|
||||
...
|
||||
elif image is not None:
|
||||
new_wallpaper = os.path.abspath(image)
|
||||
|
||||
print(f":: Wallpaper {new_wallpaper}")
|
||||
|
||||
with open(cache_file, 'w') as f:
|
||||
f.write(new_wallpaper)
|
||||
|
||||
with_image = f"with image {new_wallpaper}"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set the new wallpaper
|
||||
# -----------------------------------------------------
|
||||
|
||||
transition_type = "wipe"
|
||||
# transition_type = "outer"
|
||||
# transition_type = "random"
|
||||
|
||||
wallpaper_engine = "swww" # Default wallpaper engine
|
||||
|
||||
state("changing", "Changing wallpaper...", with_image)
|
||||
print(":: Changing wallpaper...")
|
||||
if wallpaper_engine == "swww":
|
||||
print(":: Using swww")
|
||||
|
||||
cursor_pos = subprocess.getoutput('hyprctl cursorpos')
|
||||
|
||||
subprocess.run([
|
||||
'swww', 'img', new_wallpaper,
|
||||
'--transition-bezier', '.43,1.19,1,.4',
|
||||
'--transition-fps', '60',
|
||||
'--transition-type', transition_type,
|
||||
'--transition-duration', '0.7',
|
||||
'--transition-pos', cursor_pos
|
||||
])
|
||||
else:
|
||||
print(":: Wallpaper Engine disabled")
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Square image
|
||||
# -----------------------------------------------------
|
||||
square_task = asyncio.create_task(square_image(new_wallpaper))
|
||||
|
||||
state("tasks", None, None)
|
||||
await asyncio.gather(square_task)
|
||||
state("finish", "Wallpaper procedure complete!", with_image)
|
||||
|
||||
|
||||
async def square_image(wallpaper):
|
||||
with_image = f"with image {wallpaper}"
|
||||
state(None, "Creating square version...", with_image)
|
||||
print(":: Creating square version")
|
||||
cmd = f"magick {wallpaper} -gravity Center -extent 1:1 {square}"
|
||||
process = await asyncio.create_subprocess_shell(
|
||||
cmd,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE
|
||||
)
|
||||
stdout, stderr = await process.communicate()
|
||||
|
||||
if process.returncode != 0:
|
||||
print(f":: Error while processing image: {stderr.decode()}")
|
||||
else:
|
||||
print(":: Square image created!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
acquire_lock()
|
||||
try:
|
||||
asyncio.run(main())
|
||||
finally:
|
||||
release_lock()
|
||||
@@ -1,38 +0,0 @@
|
||||
window {
|
||||
padding: 0;
|
||||
border-radius: 10px;
|
||||
border: solid 1px #1b1d1d;
|
||||
background: alpha(black, 0.75);
|
||||
}
|
||||
|
||||
#container {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
image, label {
|
||||
color: @theme_fg_color;
|
||||
}
|
||||
|
||||
progressbar:disabled,
|
||||
image:disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
progressbar {
|
||||
min-height: 5px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
trough {
|
||||
min-height: inherit;
|
||||
border-radius: inherit;
|
||||
border: none;
|
||||
background: alpha(@theme_fg_color, 0.5);
|
||||
}
|
||||
progress {
|
||||
min-height: inherit;
|
||||
border-radius: inherit;
|
||||
border: none;
|
||||
background: @theme_fg_color;
|
||||
}
|
||||