diff options
| -rw-r--r-- | .Xmodmap | 7 | ||||
| -rw-r--r-- | .xinitrc | 5 | ||||
| -rw-r--r-- | aliases | 2 | ||||
| -rwxr-xr-x | bin/akko_config | 13 | ||||
| -rwxr-xr-x | bin/futurize | 33 | ||||
| -rwxr-xr-x | bin/kbd_config | 4 | ||||
| -rwxr-xr-x | bin/pasteurize | 33 | ||||
| -rwxr-xr-x | herbstluftwm/autostart | 64 | ||||
| -rwxr-xr-x | herbstluftwm/bar | 4 | ||||
| -rwxr-xr-x | herbstluftwm/info | 76 |
10 files changed, 194 insertions, 47 deletions
@@ -1,8 +1,5 @@ -remove Mod4 = Hyper_L -add Mod3 = Hyper_L - -keysym Tab = Hyper_L -keysym ccedilla = Hyper_R +keysym Tab = Super_L +keysym ccedilla = Super_R ! to keep the keys around for xcape to use keycode 150 = Tab @@ -4,7 +4,10 @@ [ -f "$HOME/.Xresources" ] && xrdb "$HOME/.Xresources" # configuração do teclado -[ -f "$HOME/.local/bin/kbd_config" ] && . "$HOME/.local/bin/kbd_config" +[ -f "$HOME/.local/bin/kbd_config" ] && . "$HOME/.local/bin/kbd_config" & + +# configuracao do akko +[ -f "$HOME/.local/bin/akko_config"] && . "$HOME/.local/bin/akko_config" & # Setta um wallpaper aleatorio wallpaper & @@ -45,6 +45,8 @@ alias swmrc="$EDITOR ~/.spectrwm.conf" alias hlrc="$EDITOR ~/.config/herbstluftwm/autostart" +alias akko="$EDITOR ~/.config/kmonad/akko.kbd" + alias lfrc='$EDITOR ~/.config/lf/lfrc' alias vimrc='$EDITOR ~/.vim/vimrc' diff --git a/bin/akko_config b/bin/akko_config new file mode 100755 index 0000000..baf06f4 --- /dev/null +++ b/bin/akko_config @@ -0,0 +1,13 @@ +#!/bin/sh + +pgrep -x xcape && pkill -x xcape +setxkbmap -layout us + +kbd="/dev/input/by-id/usb-ROYUAN_AKKO_Multi-modes_Keyboard-B-event-kbd" +file="$HOME/.config/kmonad/akko.kbd" + +if [ -L "$kbd" ]; then + kmonad "$file" & +else + echo 'keyboard not connected' +fi diff --git a/bin/futurize b/bin/futurize new file mode 100755 index 0000000..55e95bf --- /dev/null +++ b/bin/futurize @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +# EASY-INSTALL-ENTRY-SCRIPT: 'future==0.18.2','console_scripts','futurize' +import re +import sys + +# for compatibility with easy_install; see #2198 +__requires__ = 'future==0.18.2' + +try: + from importlib.metadata import distribution +except ImportError: + try: + from importlib_metadata import distribution + except ImportError: + from pkg_resources import load_entry_point + + +def importlib_load_entry_point(spec, group, name): + dist_name, _, _ = spec.partition('==') + matches = ( + entry_point + for entry_point in distribution(dist_name).entry_points + if entry_point.group == group and entry_point.name == name + ) + return next(matches).load() + + +globals().setdefault('load_entry_point', importlib_load_entry_point) + + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(load_entry_point('future==0.18.2', 'console_scripts', 'futurize')()) diff --git a/bin/kbd_config b/bin/kbd_config index 4a3c8ef..04395d0 100755 --- a/bin/kbd_config +++ b/bin/kbd_config @@ -7,5 +7,5 @@ export DISPLAY XAUTHORITY HOME xset r rate 250 40 setxkbmap -model abnt2 -layout br -variant abnt2 -option compose:ralt -option ctrl:nocaps -option altwin:menu_win -xmodmap .Xmodmap -pgrep -x xcape || xcape -e 'Control_L=Escape;Hyper_L=Tab;Hyper_R=ccedilla' +xmodmap "$HOME/.Xmodmap" +pgrep -x xcape || xcape -e 'Control_L=Escape;Super_L=Tab;Super_R=ccedilla' diff --git a/bin/pasteurize b/bin/pasteurize new file mode 100755 index 0000000..94d0042 --- /dev/null +++ b/bin/pasteurize @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +# EASY-INSTALL-ENTRY-SCRIPT: 'future==0.18.2','console_scripts','pasteurize' +import re +import sys + +# for compatibility with easy_install; see #2198 +__requires__ = 'future==0.18.2' + +try: + from importlib.metadata import distribution +except ImportError: + try: + from importlib_metadata import distribution + except ImportError: + from pkg_resources import load_entry_point + + +def importlib_load_entry_point(spec, group, name): + dist_name, _, _ = spec.partition('==') + matches = ( + entry_point + for entry_point in distribution(dist_name).entry_points + if entry_point.group == group and entry_point.name == name + ) + return next(matches).load() + + +globals().setdefault('load_entry_point', importlib_load_entry_point) + + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(load_entry_point('future==0.18.2', 'console_scripts', 'pasteurize')()) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 0a2d4ae..12f20c2 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -28,7 +28,8 @@ for i in "${!tag_names[@]}" ; do done # modkey -Mod=Mod3 +Mod=Mod4 +launch=Mod1 # mouse hc mouseunbind --all @@ -64,12 +65,16 @@ hc rule class='Alacritty' focus=on # open applications in specific tags hc rule class=Firefox tag=www +hc rule class=firefox-default tag=www hc rule class=LibreWolf tag=www hc rule class=Chromium tag=www -hc rule class=Steam tag=game floating=on +hc rule instance=Navigator tag=www +hc rule class=Steam tag=game hc rule class=Nsxiv floating=on hc rule class=mpv tag=media hc rule class=Iwgtk floating=on +hc rule class=Code tag=dev +hc rule class=Xournalpp tag=game hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on @@ -91,6 +96,7 @@ pass_menu="passmenu2 -l 6 -p Senha:" yt_video="ytfzf -DNs" yt_audio="ytfzf -DNs --audio-only" +yt_subs="ytfzf -DN -c S --sort" screenshot_sel="scr.sh --selection" screenshot_all="scr.sh --whole-screen" @@ -150,7 +156,7 @@ brightness_up="xbacklight -inc 10" hc keyunbind --all # quit -hc keybind $Mod+Mod1+BackSpace quit +hc keybind $Mod+$launch+BackSpace quit # reload hc keybind $Mod+Shift+r reload @@ -177,21 +183,22 @@ hc keybind $Mod+apostrophe use_previous # frame control hc keybind $Mod+s split bottom 0.5 hc keybind $Mod+Shift+s split right 0.5 -hc keybind $Mod+Control+s split explode +hc keybind $Mod+e split explode +hc keybind $Mod+r rotate # window control hc keybind $Mod+minus close -hc keybind $Mod+Control+minus close_and_remove hc keybind $Mod+j cycle -1 hc keybind $Mod+k cycle +1 hc keybind $Mod+i jumpto urgent +hc keybind $Mod+Control+minus close_or_remove hc keybind $Mod+Control+j cycle_frame -1 hc keybind $Mod+Control+k cycle_frame +1 hc keybind $Mod+f fullscreen toggle -hc keybind $Mod+space set_attr clients.focus.floating toggle; wmMove center +hc keybind $Mod+Shift+space set_attr clients.focus.floating toggle; wmMove center # spawn some programs @@ -199,14 +206,15 @@ hc keybind $Mod+Return spawn $term hc keybind $Mod+Control+Return spawn $padrao hc keybind $Mod+Shift+Return spawn $clean_term -hc keybind Mod1+Shift+d spawn $dev -hc keybind Mod1+Shift+s spawn $town +hc keybind $launch+Shift+d spawn $dev +hc keybind $launch+Shift+s spawn $town -hc keybind Mod4+p spawn $menu -hc keybind Mod4+Shift+p spawn $pass_menu +hc keybind $launch+p spawn $menu +hc keybind $launch+Shift+p spawn $pass_menu -hc keybind Mod4+y spawn $yt_video -hc keybind Mod4+a spawn $yt_audio +hc keybind $launch+y spawn $yt_video +hc keybind $launch+a spawn $yt_audio +hc keybind $launch+s spawn $yt_subs hc keybind Print spawn $screenshot_sel hc keybind Mod1+Print spawn $screenshot_all @@ -214,31 +222,31 @@ hc keybind Control+Print spawn $screenshot_wind hc keybind Control+Print spawn $screenshot_wind -hc keybind Mod4+Mod1+l spawn $lock +hc keybind $launch+l spawn $lock -hc keybind Mod4+Control+v spawn $vscode -hc keybind Mod4+Control+s spawn $game +hc keybind $launch+Control+v spawn $vscode +hc keybind $launch+Control+s spawn $game -hc keybind Mod4+b spawn $browser -hc keybind Mod4+Shift+b spawn $priv_browser +hc keybind $launch+b spawn $browser +hc keybind $launch+Shift+b spawn $priv_browser -hc keybind Mod4+Mod1+space spawn $clear_notifs +hc keybind $launch+space spawn $clear_notifs hc keybind $Mod+c spawn $clear_clip -hc keybind Mod4+w spawn $change_wall +hc keybind $launch+w spawn $change_wall -hc keybind Mod4+Shift+1 spawn $run +hc keybind $launch+Shift+1 spawn $run -hc keybind Mod4+f spawn $file -hc keybind Mod4+e spawn $editor -hc keybind Mod4+n spawn $news -hc keybind Mod4+s spawn $mixer -hc keybind Mod4+h spawn $monitor -hc keybind Mod4+c spawn $calc +hc keybind $launch+f spawn $file +hc keybind $launch+e spawn $editor +hc keybind $launch+n spawn $news +hc keybind $launch+m spawn $mixer +hc keybind $launch+h spawn $monitor +hc keybind $launch+c spawn $calc -hc keybind Mod4+F11 spawn $abnt2 -hc keybind Mod4+F12 spawn $ru +hc keybind $launch+F11 spawn $abnt2 +hc keybind $launch+F12 spawn $ru hc keybind $Mod+Shift+f spawn $win_select diff --git a/herbstluftwm/bar b/herbstluftwm/bar index d2d1cc1..43fd5c9 100755 --- a/herbstluftwm/bar +++ b/herbstluftwm/bar @@ -11,13 +11,13 @@ font_std="Iosevka:style=Regular:size=14" font_icon="Symbols Nerd Font:style=1000-em:size=14" bar_height=40 -herbstclient pad 0 "$(expr $bar_height + $(expr $bar_height / 2))" +herbstclient pad 0 "$(($bar_height + $(($bar_height / 2))))" . "$info" | lemonbar -o 0 \ -f "$font_std" \ -o -4 \ -f "$font_icon" \ - -u 0 \ + -u 4 \ -gx"$bar_height" \ -d \ -p diff --git a/herbstluftwm/info b/herbstluftwm/info index b835c9f..f34c458 100755 --- a/herbstluftwm/info +++ b/herbstluftwm/info @@ -1,23 +1,19 @@ #!/bin/env bash -# herbstluftwm statusbar script -# colors . "$HOME/.config/colors" show_date() { echo "$(date '+%d %b %H:%M ')" } -show_hlwm() { - tags="$(herbstclient tag_status | sed -e 's;#; %{B#e60053};')" - - echo -n "$tags%{B-}" +current_tag() { + echo "<$(herbstclient attr tags.focus.name)>" } show_title() { title="$(xdotool getwindowfocus getwindowname | sed -e 's;herbstluftwm;;')" - printf "%.30s" "$title" + printf "%s" "$title" } show_cpu() { @@ -85,6 +81,68 @@ show_vol() { echo "%{F$cyan}$icon $vol%%{F-}" } -while :; do - echo "%{l}$(show_hlwm) | $(show_title) %{r}| $(show_cpu) | $(show_mem) | $(show_temp) | $(show_vol) | $(show_wlan) | $(show_batt) | $(show_date)" +while true ; do + echo "%{l}$(current_tag) | $(show_title) %{r}| $(show_cpu) | $(show_mem) | $(show_temp) | $(show_vol) | $(show_wlan) | $(show_batt) | $(show_date)" done + +# original script: +# https://github.com/polybar/polybar-scripts/blob/master/polybar-scripts/info-hlwm-workspaces/info-hlwm-workspaces.sh + +#herbstclient --idle "tag_*" 2>/dev/null | { +# +# while true; do +# # extra info goes here +# echo -n "%{r}| $(show_cpu) | $(show_mem) | $(show_temp) | $(show_vol) | $(show_wlan) | $(show_batt) | $(show_date)" +# echo -n "%{l}" +# +# # Read tags into $tags as array +# IFS=$'\t' read -ra tags <<< "$(herbstclient tag_status "${MON_IDX}")" +# { +# for i in "${tags[@]}" ; do +# # Read the prefix from each tag and render them according to that prefix +# case ${i:0:1} in +# '.') +# # the tag is empty +# # TODO Add your formatting tags +# ;; +# ':') +# # the tag is not empty +# # TODO Add your formatting tags +# echo -n "%{+u}%{U$red}" +# ;; +# '+') +# # the tag is viewed on the specified MONITOR, but this monitor is not focused. +# # TODO Add your formatting tags +# ;; +# '#') +# # the tag is viewed on the specified MONITOR and it is focused. +# echo -n "%{B$red}" +# ;; +# '-') +# # the tag is viewed on a different MONITOR, but this monitor is not focused. +# # TODO Add your formatting tags +# ;; +# '%') +# # the tag is viewed on a different MONITOR and it is focused. +# # TODO Add your formatting tags +# ;; +# '!') +# # the tag contains an urgent window +# # TODO Add your formatting tags +# ;; +# esac +# +# # focus the monitor of the current bar before switching tags +# echo "%{A1:herbstclient focus_monitor ${MON_IDX}; herbstclient use ${i:1}:} ${i:1} %{A -u -o F- B-}" +# done +# +# # reset foreground and background color to default +# echo "%{F-}%{B-}" +# } | tr -d "\n" +# +# echo +# +# # wait for next event from herbstclient --idle +# read -r || break +#done +#} 2>/dev/null |
