From ff786e3ce6b4321183b90ffafbc9e5f185031e40 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 4 Mar 2025 15:42:45 +0300 Subject: [PATCH] [+] update pr34 1. add dotfiles deploy via .tar.xz; 2. update .sway/config; 3. update test_crypto.py; --- .gitattributes | 1 + Makefile | 9 ++ dotfiles/.sway/config | 86 +++++++++++++++---- .../online/fxreader/pr34/tests/test_crypto.py | 21 ++--- releases/tar/dotfiles-0.1.tar.xz | 3 + 5 files changed, 91 insertions(+), 29 deletions(-) create mode 100644 releases/tar/dotfiles-0.1.tar.xz diff --git a/.gitattributes b/.gitattributes index e69de29..f82bd0d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -0,0 +1 @@ +releases/tar/** filter=lfs diff=lfs merge=lfs -text diff --git a/Makefile b/Makefile index 2392d8d..00e74e5 100644 --- a/Makefile +++ b/Makefile @@ -80,3 +80,12 @@ dotfiles_fetch: commands install -f -p ~ -s ~/.config/katerc -t dotfiles commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles + +DOTFILES_VERSION ?= 0.1 + +dotfiles_deploy: + mkdir -p releases/tar + tar -cvf - \ + dotfiles \ + | xz --compress -9 --stdout > \ + releases/tar/dotfiles-$(DOTFILES_VERSION).tar.xz diff --git a/dotfiles/.sway/config b/dotfiles/.sway/config index 0cc555a..ff80706 100644 --- a/dotfiles/.sway/config +++ b/dotfiles/.sway/config @@ -19,7 +19,8 @@ set $term weston-terminal # on the original workspace that the command was run on. #for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10 #set $menu exec $term --class=launcher -e /usr/bin/sway-launcher-desktop -set $dmenu_path /usr/bin/bemenu-run +#set $dmenu_path /usr/bin/bemenu-run +set $dmenu_path rofi -modes run -show run set $menu $dmenu_path | xargs swaymsg exec -- @@ -64,10 +65,12 @@ bindgesture swipe:4:right workspace prev for_window [shell="xwayland"] title_format "[XWayland] %title" +#set $lock_cmd \ +# loginctl list-sessions | \ +# tail '-n' +2 | head -n -2 | awk '{print $1}' | \ +# xargs loginctl lock-session set $lock_cmd \ - loginctl list-sessions | \ - tail '-n' +2 | head -n -2 | awk '{print $1}' | \ - xargs loginctl lock-session + zsh -c "commands loginctl --action lock-session" bindgesture swipe:4:up exec $lock_cmd @@ -76,14 +79,14 @@ bindgesture swipe:4:up exec $lock_cmd # # Basics: # -bindsym $mod+Shift+l exec $lock_cmd +bindsym Shift+$mod+l exec $lock_cmd -bindsym Shift+mod1+1 \ +bindsym --locked Shift+mod1+1 \ exec ~/.local/bin/commands \ desktop-services \ --cpufreq-action performance -bindsym Shift+mod1+2 \ +bindsym --locked Shift+mod1+2 \ exec ~/.local/bin/commands \ desktop-services \ --cpufreq-action powersave @@ -140,7 +143,11 @@ floating_modifier $mod normal bindsym $mod+Shift+c reload # Exit sway (logs you out of your Wayland session) -bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +bindsym $mod+Shift+e \ + exec swaynag -t warning \ + -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' \ + -b 'Yes, exit sway' \ + 'swaymsg exit' # # Moving around: # @@ -224,7 +231,8 @@ bindsym $mod+p floating toggle ## Swap focus between the tiling area and the floating area #bindsym $mod+space focus mode_toggle -bindsym --release Print exec bash -c "commands wl-screenshot" +bindsym --release Print exec zsh -c "commands wl-screenshot" +bindsym --release $mod+s exec zsh -c "commands wl-screenshot" # Move focus to the parent container #bindsym $mod+a focus parent @@ -265,6 +273,40 @@ mode "resize" { } bindsym $mod+r mode "resize" +set $black #000000 +set $red #ff0000 +set $green #00ff00 +set $blue #0000ff +set $white #ffffff +set $grey #757575 +set $pale_green #9df882 +set $pale_green2 #6baf54 +set $dark_green #1a7000 +set $pale_blue #7da9f9 +set $dark_blue #005ba6 +set $pale_greenblue #2da078 +set $pale_greenblue2 #66c473 +set $yellow #fffd0d +set $dark_yellow #908f00 + +set $color1 #18ff00 +set $color2 #000000 +set $color3 #ff00ff +set $color4 #ff0000 +set $color5 #00000000 +set $color6 #00000000 +set $color7 #00000000 + +set $border_focused $pale_green +set $border_unfocused $color2 +set $background_focused $pale_greenblue2 +set $background_unfocused $grey +set $child_border_focused $white +set $child_border_unfocused $color2 + +set $bright_text $white +set $dark_text $black + # # Status Bar: # @@ -284,27 +326,34 @@ bar { height 16 colors { - statusline #565656 - background #dfdfdf - inactive_workspace #dfdfdf #dfdfdf #000000 - active_workspace #dfdfdf #efefef #000000 - focused_workspace #dfdfdf #efefef #000000 + statusline $bright_text + background $pale_green2 + inactive_workspace $black $white $dark_text + active_workspace $black $white $bright_text + focused_workspace $dark_yellow $yellow $dark_text } } -client.focused #f3f3f3 #dfdfdf #565656 #f3f3f3 #f3f3f3 -client.unfocused #f3f3f3 #dfdfdf #565656 #f3f3f3 #f3f3f3 + +#client.focused #f3f3f3 #dfdfdfdd #565656 #f3f3f3 #f3f3f3 +client.focused $border_focused $background_focused $white $white $child_border_focused +client.unfocused $border_unfocused $background_unfocused $white $white $child_border_unfocused + +for_window [all] border 1 #font pango:Helvetica Neue 10 -font pango:Terminus 10 +font pango:Terminus 12 -titlebar_padding 1 4 +titlebar_padding 32 1 +titlebar_border_thickness 1 title_align center #for_window [class=".*"] title_format "%title" for_window [class="^firefox$"] floating enable +for_window [all] opacity set 0.95 + input * { xkb_layout "us,ru" xkb_options "grp:win_space_toggle" @@ -313,4 +362,3 @@ input type:keyboard xkb_model "pc101" include /etc/sway/config.d/* include ~/.sway/config.d/* - diff --git a/python/online/fxreader/pr34/tests/test_crypto.py b/python/online/fxreader/pr34/tests/test_crypto.py index 60e7881..d8d9f75 100644 --- a/python/online/fxreader/pr34/tests/test_crypto.py +++ b/python/online/fxreader/pr34/tests/test_crypto.py @@ -6,14 +6,15 @@ class TestCrypto(unittest.TestCase): def test_password_utils(self) -> None: salt = b'asdfasdfasdf' - self.assertEqual( - crypto.PasswordUtils.encrypt( - 'blah', - mode='bytes', - salt=salt, - ), - [ - salt, - b'asdfasdf', - ] + encrypt_res = crypto.PasswordUtils.encrypt( + 'blah', + mode='bytes', + salt=salt, + ) + self.assertEqual( + encrypt_res, + ( + salt, + b'\xdak\xd15\xfa\x8e\xc8\r\xc3\xd2c\xf1m\xb0\xbf\xe6\x98\x01$!j\xc8\xc0Hh\x84\xea,\x91\x8b\x08\xce', + ), ) diff --git a/releases/tar/dotfiles-0.1.tar.xz b/releases/tar/dotfiles-0.1.tar.xz new file mode 100644 index 0000000..7e1601f --- /dev/null +++ b/releases/tar/dotfiles-0.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:458377960afb79eb2fc823879d2f78b28c91b6ca3f49bbe7e27601c70aca1222 +size 22812