Compare commits
No commits in common. "8c396b710132aa2791e6e9b2d9874f59347f93e8" and "3ae6f01d88dacdcd334b492818f248b422338b6b" have entirely different histories.
8c396b7101
...
3ae6f01d88
|
@ -1,5 +1,2 @@
|
|||
helix/runtime
|
||||
fish/fish_variables
|
||||
# openbsd crash core dumps
|
||||
*.core
|
||||
*.log
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# - /path/to/alacritty.yml
|
||||
import:
|
||||
- ~/.alacritty-colorscheme/themes/xterm.yaml
|
||||
- ~/.alacrittyrc.yaml
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
# environment variables. Some entries may override variables
|
||||
# set by alacritty itself.
|
||||
|
@ -22,7 +22,7 @@ env:
|
|||
# This value is used to set the `$TERM` environment variable for
|
||||
# each instance of Alacritty. If it is not present, alacritty will
|
||||
# check the local terminfo database and use `alacritty` if it is
|
||||
# available, otherwise `xterm-256color` i_configs used.
|
||||
# available, otherwise `xterm-256color` is used.
|
||||
TERM: alacritty
|
||||
|
||||
#window:
|
||||
|
@ -175,7 +175,7 @@ env:
|
|||
#use_thin_strokes: true
|
||||
|
||||
# If `true`, bold text is drawn using the bright color variants.
|
||||
draw_bold_text_with_bright_colors: false
|
||||
#draw_bold_text_with_bright_colors: false
|
||||
|
||||
# Colors (Tomorrow Night)
|
||||
#colors:
|
||||
|
@ -409,7 +409,7 @@ draw_bold_text_with_bright_colors: false
|
|||
#thickness: 0.15
|
||||
|
||||
# Live config reload (changes require restart)
|
||||
live_config_reload: true
|
||||
#live_config_reload: true
|
||||
|
||||
# Shell
|
||||
#
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,8 @@ SpellEnabled=True
|
|||
EmojiEnabled=True
|
||||
# Enable Chaizi
|
||||
ChaiziEnabled=True
|
||||
# Enable Characters in Unicode CJK Extension B
|
||||
ExtBEnabled=True
|
||||
# Enable Cloud Pinyin
|
||||
CloudPinyinEnabled=False
|
||||
# Cloud Pinyin Index
|
||||
|
@ -24,10 +26,16 @@ PinyinInPreedit=False
|
|||
Prediction=False
|
||||
# Prediction Size
|
||||
PredictionSize=10
|
||||
# Action when switching input method
|
||||
SwitchInputMethodBehavior="Commit current preedit"
|
||||
# Select 2nd Candidate
|
||||
SecondCandidate=
|
||||
# Select 3rd Candidate
|
||||
ThirdCandidate=
|
||||
# Use Keypad as Selection key
|
||||
UseKeypadAsSelection=False
|
||||
# Use BackSpace to cancel the selection
|
||||
BackSpaceToUnselect=True
|
||||
# Number of Sentences
|
||||
Number of sentence=2
|
||||
# Prompt long word length when input length over (0 for disable)
|
||||
|
@ -80,7 +88,7 @@ FirstRun=False
|
|||
[Fuzzy]
|
||||
# ue -> ve
|
||||
VE_UE=True
|
||||
# gn -> ng
|
||||
# Common Typo
|
||||
NG_GN=True
|
||||
# Inner Segment (xian -> xi'an)
|
||||
Inner=True
|
||||
|
|
|
@ -3,9 +3,5 @@ set -x TERM "xterm-256color"
|
|||
alias hc=herbstclient
|
||||
set fish_greeting ""
|
||||
|
||||
# Add local bin paths
|
||||
fish_add_path $HOME/.cargo/bin
|
||||
fish_add_path $HOME/.bin
|
||||
|
||||
# Local per-machine changes
|
||||
source $HOME/.fishrc
|
|
@ -1,18 +1,34 @@
|
|||
#!/usr/bin/env
|
||||
source (status dirname)/../include/parent.fish
|
||||
|
||||
function parent_dir
|
||||
set -f trace (status stack-trace)
|
||||
# By index:
|
||||
# 1: in command substitution
|
||||
# 2: parent.fish line
|
||||
# 3: in function 'parent'
|
||||
# 4: caller import line
|
||||
# 5: in command substitution
|
||||
# 6: caller "parent" invokation line
|
||||
# 7: in function calling parent
|
||||
# 8: jackpot! here's the parent of the caller
|
||||
set -f parent_line $trace[8]
|
||||
set -f parent_split (string split 'of file' $parent_line)
|
||||
set -f parent (string trim $parent_split[2])
|
||||
|
||||
# qualify ~
|
||||
set -f parent (string replace '~' "$HOME" $parent)
|
||||
|
||||
# Qualify the path to absolute and remove the filename
|
||||
set -f parent_dir (realpath $parent)
|
||||
set -f parent (string join '/' (string split '/' $parent_dir)[1..-2])
|
||||
echo $parent
|
||||
end
|
||||
|
||||
function import
|
||||
set -f self_directory (parent_script_dir)
|
||||
set -f self_directory (parent_dir)
|
||||
if set -q debug;
|
||||
echo "importing $argv.fish from [$self_directory]"
|
||||
end
|
||||
if starts_with '@' "$argv"
|
||||
set -f include_dir "$(status dirname)/../include/"
|
||||
set -f import_path \
|
||||
(string replace '@' "$include_dir" "$argv")
|
||||
source "$import_path.fish"
|
||||
return 0
|
||||
end
|
||||
if starts_with '/' "$argv"
|
||||
source "$argv.fish"
|
||||
return 0
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
import @parent
|
||||
|
||||
# calls logger with a specific color
|
||||
#
|
||||
# examples:
|
||||
#
|
||||
# log "hello there"
|
||||
# log -c magenta "im berry"
|
||||
# log --color cc00cc "just like the blueberries"
|
||||
function log
|
||||
set -f log_name (parent_script)
|
||||
# hlwm config particular
|
||||
set -f cfg_color \
|
||||
(hc attr settings.my_Color_$log_name 2> /dev/null)
|
||||
|
||||
argparse 'c/color=' -- $argv
|
||||
if not set -q _flag_color; or test -n "$_flag_color"
|
||||
if test -n "$cfg_color"
|
||||
set -g _flag_color $cfg_color
|
||||
else
|
||||
set -g _flag_color green
|
||||
end
|
||||
end
|
||||
|
||||
echo -s "[ " (set_color $_flag_color) $log_name (set_color normal) " ]: $argv" 1>&2
|
||||
end
|
|
@ -1,51 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# parent_script prints the parent script's filename
|
||||
function parent_script
|
||||
set -f trace (status stack-trace)
|
||||
# By index:
|
||||
# 1: in command substitution
|
||||
# 2: parent.fish line
|
||||
# 3: in function 'parent'
|
||||
# 4: caller import line
|
||||
# 5: in command substitution
|
||||
# 6: caller "parent" invokation line
|
||||
# 7: in function calling parent
|
||||
# 8: jackpot! here's the parent of the caller
|
||||
set -f parent_line $trace[8]
|
||||
set -f parent_split (string split 'of file' $parent_line)
|
||||
set -f parent (string trim $parent_split[2])
|
||||
# Clean up the parent a lil bit
|
||||
set -f parent (realpath (string replace '~' "$HOME" $parent))
|
||||
set -f parent_parts (string split '/' $parent)
|
||||
set -f parent (string join '/' $parent_parts[-1])
|
||||
|
||||
# remove .fish suffix
|
||||
set -f parent (string replace '.fish' '' $parent)
|
||||
|
||||
echo $parent
|
||||
end
|
||||
|
||||
function parent_script_dir
|
||||
set -f trace (status stack-trace)
|
||||
# By index:
|
||||
# 1: in command substitution
|
||||
# 2: parent.fish line
|
||||
# 3: in function 'parent'
|
||||
# 4: caller import line
|
||||
# 5: in command substitution
|
||||
# 6: caller "parent" invokation line
|
||||
# 7: in function calling parent
|
||||
# 8: jackpot! here's the parent of the caller
|
||||
set -f parent_line $trace[8]
|
||||
set -f parent_split (string split 'of file' $parent_line)
|
||||
set -f parent (string trim $parent_split[2])
|
||||
|
||||
# qualify ~
|
||||
set -f parent (string replace '~' "$HOME" $parent)
|
||||
|
||||
# Qualify the path to absolute and remove the filename
|
||||
set -f parent_dir (realpath $parent)
|
||||
set -f parent (string join '/' (string split '/' $parent_dir)[1..-2])
|
||||
echo $parent
|
||||
end
|
|
@ -6,4 +6,4 @@ auto-completion = true
|
|||
#left = ["mode", "spinner"]
|
||||
|
||||
[editor.lsp]
|
||||
# display-messages = true
|
||||
display-messages = true
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env fish
|
||||
set -g FISH_CMDS_PATH $HOME/.config/herbstluftwm/fish_cmds
|
||||
|
||||
# cmd_string returns the shell command to invoke
|
||||
# the fish_cmds file title given to it as an argument
|
||||
function cmd_string
|
||||
set -f FISH_PATH (status fish-path)
|
||||
printf "$FISH_PATH\n$FISH_CMDS_PATH/$argv.fish"
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
function hlwm_active
|
||||
echo (herbstclient attr theme.active.color)
|
||||
end
|
||||
|
||||
function hlwm_normal
|
||||
echo (herbstclient attr theme.normal.color)
|
||||
end
|
||||
|
||||
function hlwm_text
|
||||
echo (herbstclient attr theme.normal.title_color)
|
||||
end
|
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
import @parent
|
||||
alias hc=herbstclient
|
||||
|
||||
function new_config
|
||||
argparse -i 'n/name=' 'v/value=' 't/type=' -- $argv
|
||||
set_default _flag_type 'string'
|
||||
if test -z "$_flag_name"; or test -z "$_flag_value"
|
||||
log -c 'red' "name and value must be set"
|
||||
return 1
|
||||
end
|
||||
set -f cfg_name (printf 'settings.my_%s' $_flag_name)
|
||||
|
||||
hc get_attr settings.my_$_flag_name &> /dev/null
|
||||
if test $status -eq 0
|
||||
hc set_attr "settings.my_$_flag_name" \
|
||||
$_flag_value #&> /dev/null
|
||||
else
|
||||
hc new_attr "$_flag_type" \
|
||||
"$cfg_name" \
|
||||
"$_flag_value" #&> /dev/null
|
||||
end
|
||||
end
|
||||
|
||||
function set_config
|
||||
argparse -i 'n/name=' 'v/value=' -- $argv
|
||||
if test -z "$_flag_name"; or test -z "$_flag_value";
|
||||
log -c 'red' "name and value must be set"
|
||||
return 1
|
||||
end
|
||||
set -f cfg_name (printf 'settings.my_%s' $_flag_name)
|
||||
|
||||
hc set_attr $cfg_name $_flag_value
|
||||
end
|
||||
|
||||
function get_config
|
||||
set -f cfg_name (printf 'settings.my_%s' "$argv")
|
||||
|
||||
hc get_attr $cfg_name
|
||||
end
|
||||
|
||||
function set_log_color
|
||||
set -f parent (parent_script)
|
||||
new_config \
|
||||
-t string \
|
||||
-n "$(printf 'Color_%s' "$parent")" \
|
||||
-v "$argv"
|
||||
end
|
|
@ -1,21 +1,18 @@
|
|||
#!/usr/bin/env
|
||||
import notify
|
||||
import config
|
||||
import log
|
||||
|
||||
alias hc=herbstclient
|
||||
|
||||
set_log_color "ff99cc"
|
||||
set -g tag_color "ff99cc"
|
||||
|
||||
# group_active_reset resets the active group to 1
|
||||
# group_active_reset resets the active group (unset)
|
||||
function group_active_reset
|
||||
new_config \
|
||||
-t uint \
|
||||
-n ActiveGroup \
|
||||
-v 1
|
||||
set -q hlwm_group_active
|
||||
end
|
||||
|
||||
function group_switch
|
||||
set -f current (get_config ActiveGroup)
|
||||
set -f current $hlwm_group_active
|
||||
|
||||
set -f arg $argv[1]
|
||||
if not set -q arg
|
||||
|
@ -29,36 +26,33 @@ function group_switch
|
|||
# is a number
|
||||
group_index $arg
|
||||
else
|
||||
log "invalid group index [$arg], use '+', '-', or a real integer"
|
||||
log -c $tag_color "invalid group index [$arg], use '+', '-', or a real integer"
|
||||
return 1
|
||||
end
|
||||
|
||||
# update the tag it should now be on, if it switched
|
||||
if test (get_config ActiveGroup) -ne $current
|
||||
if test $hlwm_group_active -ne $current
|
||||
update_tag $current
|
||||
end
|
||||
group_set_keybinds
|
||||
set -f active (get_config ActiveGroup)
|
||||
notify "Group $active"
|
||||
log "group $current -> $active"
|
||||
notify "Group $hlwm_group_active"
|
||||
log -c $tag_color "group $current -> $hlwm_group_active"
|
||||
end
|
||||
|
||||
# move_to_group moves the focused window to the
|
||||
# relative tag on a given group
|
||||
# move_to_group moves the focused window to the relative tag on
|
||||
# a given group
|
||||
function move_to_group
|
||||
set -f move_to "$argv"
|
||||
set -f active (get_config ActiveGroup)
|
||||
if test "$move_to" = "$active"
|
||||
log "ignoring move as it's already in the active group"
|
||||
if test "$move_to" = "$hlwm_group_active"
|
||||
log -c $tag_color "ignoring move as it's already in the active group"
|
||||
return 0
|
||||
else if test $move_to -lt 1; or \
|
||||
$move_to -gt (get_config GroupCount)
|
||||
log "invalid group index [$move_to]:" \
|
||||
"out of range [1:$(get_config GroupCount)]"
|
||||
else if test $move_to -lt 1 -o $move_to -gt $hlwm_group_count
|
||||
log -c $tag_color "invalid group index [$move_to]:" \
|
||||
"out of range [1:$hlwm_group_count]"
|
||||
return 1
|
||||
end
|
||||
set -f new_tag (translate_tag $active $move_to)
|
||||
log "moving window to group [$move_to]" \
|
||||
set -f new_tag (translate_tag $hlwm_group_active $move_to)
|
||||
log -c $tag_color "moving window to group [$move_to]" \
|
||||
"tag -> $new_tag"
|
||||
end
|
||||
|
||||
|
@ -70,83 +64,66 @@ function translate_tag
|
|||
set -f current_actual (hc attr tags.focus.index)
|
||||
set -f tl_from $argv[1]
|
||||
set -f tl_to $argv[2]
|
||||
set -f offset_from \
|
||||
(math \
|
||||
(math $tl_from - 1) x \
|
||||
(get_config TagsPerGroup))
|
||||
set -f offset_to \
|
||||
(math \
|
||||
(math $tl_to - 1) x \
|
||||
(get_config TagsPerGroup))
|
||||
set -f relative_tag_from \
|
||||
(math $current_actual - $offset_from)
|
||||
log \
|
||||
"calculated relative tag to" \
|
||||
"group [$tl_from] to be" \
|
||||
"[$relative_tag_from]"
|
||||
set -f actual_tag_to \
|
||||
(math $relative_tag_from + $offset_to)
|
||||
log \
|
||||
"relative tag" \
|
||||
"[$relative_tag_from]" \
|
||||
"translated to group [$tl_to]"\
|
||||
set -f offset_from (math (math $tl_from - 1) x $hlwm_tags_per_group)
|
||||
set -f offset_to (math (math $tl_to - 1) x $hlwm_tags_per_group)
|
||||
set -f relative_tag_from (math $current_actual - $offset_from)
|
||||
log -c $tag_color \
|
||||
"calculated relative tag to group [$tl_from] to be [$relative_tag_from]"
|
||||
set -f actual_tag_to (math $relative_tag_from + $offset_to)
|
||||
log -c $tag_color \
|
||||
"relative tag [$relative_tag_from] translated to group [$tl_to]" \
|
||||
"becomes actual tag [$actual_tag_to]"
|
||||
echo $actual_tag_to
|
||||
end
|
||||
|
||||
function update_tag
|
||||
set -f new_tag (translate_tag $argv \
|
||||
$(get_config ActiveGroup))
|
||||
log "moving frame focus to tag: [$new_tag]"
|
||||
set -f new_tag (translate_tag $argv $hlwm_group_active)
|
||||
log -c $tag_color "moving frame focus to tag: [$new_tag]"
|
||||
hc use_index $new_tag
|
||||
end
|
||||
|
||||
function group_down
|
||||
set -f active_grp (get_config ActiveGroup)
|
||||
if not set -q active_grp; or \
|
||||
test $active_grp -eq 1
|
||||
if not set -q hlwm_group_active
|
||||
# Treat unset == 1, so move back to the last one
|
||||
set_config -n ActiveGroup -v (get_config GroupCount)
|
||||
set -U hlwm_group_active $hlwm_group_count
|
||||
else if test $hlwm_group_active -eq 1
|
||||
set -U hlwm_group_active $hlwm_group_count
|
||||
else
|
||||
set_config -n ActiveGroup -v (math $active_grp - 1)
|
||||
end
|
||||
end
|
||||
|
||||
function group_up
|
||||
set -f active_grp (get_config ActiveGroup)
|
||||
if test $active_grp -le 1
|
||||
set_config -n ActiveGroup -v 2
|
||||
else if test $active_grp -eq (get_config GroupCount)
|
||||
set_config -n ActiveGroup -v 1
|
||||
else
|
||||
set_config -n ActiveGroup \
|
||||
-v (math $active_grp + 1)
|
||||
set -U hlwm_group_active (math $hlwm_group_active - 1)
|
||||
end
|
||||
end
|
||||
|
||||
function group_index
|
||||
if test $argv -gt (get_config GroupCount)
|
||||
set -f $argv (get_config GroupCount)
|
||||
if test $argv -gt $hlwm_group_count
|
||||
set -f $argv $hlwm_group_count
|
||||
else if test $argv -lt 1
|
||||
set -f $argv 1
|
||||
end
|
||||
|
||||
set_config -n ActiveGroup -v $argv
|
||||
set -U hlwm_group_active $argv
|
||||
end
|
||||
|
||||
function group_up
|
||||
if not set -q hlwm_group_active
|
||||
set -U hlwm_group_active 2
|
||||
else if test $hlwm_group_active -eq $hlwm_group_count
|
||||
set -U hlwm_group_active 1
|
||||
else
|
||||
set -U hlwm_group_active (math $hlwm_group_active + 1)
|
||||
end
|
||||
end
|
||||
|
||||
# group_set_keybinds sets the keybinds to the given tab group
|
||||
function group_set_keybinds
|
||||
set_default hlwm_mod (get_config ModKey)
|
||||
set -f grp (get_config ActiveGroup)
|
||||
set -f tags_per (get_config TagsPerGroup)
|
||||
log "setting keybinds for group: $grp"
|
||||
set -l offset (math \
|
||||
(math $grp-1) x $tags_per)
|
||||
for tag in (seq $tags_per)
|
||||
set_default hlwm_mod Mod4
|
||||
log -c $tag_color "setting keybinds for group: $hlwm_group_active"
|
||||
if not set -q hlwm_group_active;
|
||||
set -U hlwm_group_active 1
|
||||
end
|
||||
set -l offset (math (math $hlwm_group_active-1) x $hlwm_tags_per_group)
|
||||
for tag in (seq $hlwm_tags_per_group)
|
||||
set -l actual_tag (math $tag + $offset)
|
||||
hc keybind $hlwm_mod-$tag use_index \
|
||||
(math $actual_tag - 1)
|
||||
hc keybind $hlwm_mod-Shift-$tag move_index \
|
||||
(math $actual_tag - 1)
|
||||
hc keybind $hlwm_mod-$tag use_index (math $actual_tag-1)
|
||||
hc keybind $hlwm_mod-Shift-$tag move_index (math $actual_tag-1)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env fish
|
||||
import parent
|
||||
|
||||
# calls logger with a specific color
|
||||
#
|
||||
# examples:
|
||||
#
|
||||
# log "hello there"
|
||||
# log -c magenta "im berry"
|
||||
# log --color cc00cc "just like the blueberries"
|
||||
function log
|
||||
set -f log_name (parent)
|
||||
argparse 'c/color=' -- $argv
|
||||
if not set -q _flag_color;
|
||||
set -g _flag_color green
|
||||
end
|
||||
|
||||
echo -s "[ " (set_color $_flag_color) $log_name (set_color normal) " ]: $argv" 1>&2
|
||||
end
|
|
@ -1,29 +1,24 @@
|
|||
#!/usr/bin/env fish
|
||||
import config
|
||||
import colors
|
||||
import log
|
||||
|
||||
set_default notify_fg (hlwm_text)
|
||||
set_default notify_bg (hlwm_normal)
|
||||
set_default notify_font $hlwm_font
|
||||
set_default notify_padding 30
|
||||
|
||||
function notify
|
||||
argparse -i 'fg=' \
|
||||
'bg=' \
|
||||
'f/font=' \
|
||||
'p/padding=' \
|
||||
'secs=!_validate_int --min 1' \
|
||||
-- $argv
|
||||
set_default _flag_fg (get_config NotifyTextColor)
|
||||
set_default _flag_bg (get_config NotifyBgColor)
|
||||
set_default _flag_font (get_config Font)
|
||||
set_default _flag_padding 30
|
||||
argparse -i 'secs=!_validate_int --min 1' -- $argv
|
||||
set_default _flag_secs 1
|
||||
|
||||
log "using font '$_flag_font'"
|
||||
set -f text_width (textwidth "$_flag_font" "$argv")
|
||||
set -f text_width (textwidth "$notify_font" "$argv")
|
||||
|
||||
echo "$argv" | \
|
||||
dzen2 \
|
||||
-p $_flag_secs \
|
||||
-fg $_flag_fg \
|
||||
-bg $_flag_bg \
|
||||
-fn $_flag_font \
|
||||
-fg $notify_fg \
|
||||
-bg $notify_bg \
|
||||
-fn $notify_font \
|
||||
-ta 'c' \
|
||||
-w (math $text_width + $_flag_padding) \
|
||||
-w (math $text_width + $notify_padding) \
|
||||
-h 16
|
||||
end
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# parent prints the parent script's filename
|
||||
function parent
|
||||
set -f trace (status stack-trace)
|
||||
# By index:
|
||||
# 1: in command substitution
|
||||
# 2: parent.fish line
|
||||
# 3: in function 'parent'
|
||||
# 4: caller import line
|
||||
# 5: in command substitution
|
||||
# 6: caller "parent" invokation line
|
||||
# 7: in function calling parent
|
||||
# 8: jackpot! here's the parent of the caller
|
||||
set -f parent_line $trace[8]
|
||||
set -f parent_split (string split 'of file' $parent_line)
|
||||
set -f parent (string trim $parent_split[2])
|
||||
# Clean up the parent a lil bit
|
||||
set -f parent (realpath (string replace '~' "$HOME" $parent))
|
||||
set -f parent_parts (string split '/' $parent)
|
||||
set -f parent (string join '/' $parent_parts[-1])
|
||||
|
||||
# remove .fish suffix
|
||||
set -f parent (string replace '.fish' '' $parent)
|
||||
|
||||
echo $parent
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
function remove_default
|
||||
set -f default_tag ( \
|
||||
hc get_attr tags.by-name.default.index \
|
||||
&> /dev/null \
|
||||
)
|
||||
if test -z "$default_tag"
|
||||
return 0
|
||||
end
|
||||
if test \
|
||||
"$(hc get_attr tags.focus.index)" = \
|
||||
"$default_tag"
|
||||
# switch from default tag
|
||||
hc use_index 1
|
||||
end
|
||||
hc merge_tag "default"
|
||||
log "removed"
|
||||
end
|
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env fish
|
||||
import log
|
||||
|
||||
alias hc=herbstclient
|
||||
|
||||
function restart_svcs
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
import fish_functions/notify
|
||||
import fish_functions/restart_svcs
|
||||
import fish_functions/group
|
||||
import fish_functions/config
|
||||
import fish_functions/remove_default
|
||||
|
||||
set -g THIS_PATH (pwd)
|
||||
log "starting in $THIS_PATH"
|
||||
|
@ -12,7 +10,6 @@ alias hc=herbstclient
|
|||
|
||||
# default font if not set
|
||||
set_default hlwm_font "-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
|
||||
new_config -n Font -v "$hlwm_font"
|
||||
|
||||
hc emit_hook reload
|
||||
if command -sq "xsetroot";
|
||||
|
@ -25,21 +22,18 @@ group_active_reset
|
|||
set -g Mod Mod4
|
||||
set -g AltMod Mod1
|
||||
|
||||
new_config ModKey $Mod
|
||||
set -U hlwm_mod $Mod
|
||||
set -u hlwm_mod $Mod
|
||||
|
||||
function key
|
||||
log "Registering $Mod-$argv[1] to [$argv[2..]]"
|
||||
hc keybind $Mod-$argv[1] $argv[2..]
|
||||
end
|
||||
|
||||
set_default hlwm_terminal_spawn_key "Home"
|
||||
|
||||
hc keybind $Mod-Shift-r reload
|
||||
hc keybind $Mod-Shift-c close
|
||||
hc keybind $Mod-s spawn "flameshot" gui
|
||||
hc keybind $Mod-Return spawn "dmenu_run"
|
||||
hc keybind $Mod-$hlwm_terminal_spawn_key spawn "alacritty"
|
||||
hc keybind $Mod-Home spawn "alacritty"
|
||||
|
||||
# basic movement in tiling and floating mode
|
||||
# focusing clients
|
||||
|
@ -68,15 +62,8 @@ hc keybind $Mod-Control-Down resize down +$resize_step
|
|||
hc keybind $Mod-Control-Up resize up +$resize_step
|
||||
hc keybind $Mod-Control-Right resize right +$resize_step
|
||||
|
||||
set_default hlwm_tags_per_group 5
|
||||
set_default hlwm_group_count 3
|
||||
new_config -n GroupCount \
|
||||
-v $hlwm_group_count \
|
||||
-t uint
|
||||
new_config -n TagsPerGroup \
|
||||
-v $hlwm_tags_per_group \
|
||||
-t uint
|
||||
|
||||
set_default -u hlwm_tags_per_group 5
|
||||
set_default -u hlwm_group_count 3
|
||||
log "registering $hlwm_group_count groups, with $hlwm_tags_per_group tags per"
|
||||
set -l tag_indexes (seq $hlwm_tags_per_group)
|
||||
|
||||
|
@ -88,8 +75,16 @@ for group_num in (seq $hlwm_group_count)
|
|||
end
|
||||
end
|
||||
|
||||
# Remove the default tag
|
||||
remove_default
|
||||
# Remove the default tag, if present (switching to the first tag)
|
||||
if set -l default_tag (hc get_attr tags.by-name.default.index)
|
||||
set -l focused_tag (hc get_attr tags.focus.index)
|
||||
if test $focused_tag -eq $default_tag
|
||||
hc use_index 1
|
||||
end
|
||||
hc merge_tag "default"
|
||||
log "removed default tag from index [$default_tag]"
|
||||
end
|
||||
|
||||
group_set_keybinds
|
||||
|
||||
# focus
|
||||
|
@ -167,11 +162,6 @@ hct urgent.inner_color $URGENT
|
|||
hct title_color white
|
||||
hct normal.title_color '#898989'
|
||||
|
||||
|
||||
new_config -n NotifyTextColor \
|
||||
-v (hc attr theme.normal.title_color)
|
||||
new_config -n NotifyBgColor -v $NORMAL
|
||||
|
||||
for state in active urgent normal
|
||||
hc substitute C theme.$state.inner_color \
|
||||
attr theme.$state.outer_color C
|
||||
|
@ -216,6 +206,7 @@ end
|
|||
log "Registering custom command binds"
|
||||
keybind_fn i "toggle_idle_screen"
|
||||
keybind_fn --direct="switch_group" "grave" "+" # backtick
|
||||
keybind_fn --direct="switch_group" "Tab-grave" "-"
|
||||
for group_index in (seq $hlwm_group_count)
|
||||
keybind_fn --direct="switch_group" "F$group_index" "$group_index"
|
||||
end
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# hlwm conf todo
|
||||
|
||||
- [ ] use hlwm attrs (new_attr in herbstluftwm(1)) rather than fish env
|
Loading…
Reference in New Issue