PNG  IHDR  8] PLTE S =tRNS   PNG  IHDR  8] PLTE S =tRNS   REDROOM
PHP 7.4.33
Preview: _localectl Size: 3.68 KB
/usr/share/zsh/site-functions/_localectl

#compdef localectl
# SPDX-License-Identifier: LGPL-2.1-or-later

(( $+functions[_localectl_set-locale] )) ||
_localectl_set-locale() {
    local -a _locales locale_fields
    locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \
                   LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \
                   LC_NAME LC_ADDRESS LC_TELEPHONE \
                   LC_MEASUREMENT LC_IDENTIFICATION)
    # LC_ALL is omitted on purpose

    local expl suf
    _locales=( ${(f)"$(_call_program locales "$service" list-locales)"} )
    compset -P1 '*='
    if [[ -prefix 1 *\= ]]; then
        local conf=${PREFIX%%\=*}
        _wanted locales expl "locales configs" \
            _combination localeconfs  confs=$conf locales "$@" -
    else
        compadd -S '=' $locale_fields
    fi
}

(( $+functions[_localectl_set-keymap] )) ||
_localectl_set-keymap() {
    local -a _keymaps
    if (( CURRENT <= 3 )); then
        _keymaps=( ${(f)"$(_call_program locales "$service" list-keymaps)"} )
        _describe keymaps _keymaps
    else
        _message "no more options"
    fi
}

(( $+functions[_localectl_set-x11-keymap] )) ||
_localectl_set-x11-keymap() {
    if (( $+commands[pkg-config] )); then
        local -a _file _layout _model _variant _options
        local _xorg_lst
        _xorg_lst=${"$($commands[pkg-config] xkeyboard-config --variable=xkb_base)"}
        _file=( ${(ps:\n\!:)"$(<$_xorg_lst/rules/base.lst)"} )
        _layout=( ${${${(M)${(f)_file[2]}:#  *}#  }%% *} )
        _model=( ${${${(M)${(f)_file[1]}:#  *}#  }%% *} )
        _variant=( ${${${(M)${(f)_file[3]}:#  *}#  }%% *} )
        _options=( ${${${(M)${(f)_file[4]}:#  *}#  }%% *} )
        #_layout=( ${(f)"$( echo $_file[1] | awk '/^  / {print $1}' )"} )
        #_model=( ${(f)"$(echo $_file[2] | awk '/^  / {print $1}')"} )
        #_variant=( ${(f)"$(echo $_file[3] | awk '/^  / {print $1}')"} )
        #_options=( ${(f)"$(echo ${_file[4]//:/\\:} | awk '/^  / {print $1}')"} )

        case $CURRENT in
            2) _describe layouts _layout ;;
            3) _describe models _model;;
            4) _describe variants _variant;;
            5) _describe options _options;;
            *) _message "no more options"
        esac
    fi
}

(( $+functions[_localectl_commands] )) ||
_localectl_commands() {
    local -a _localectl_cmds
    _localectl_cmds=(
        'status:Show current locale settings'
        'set-locale:Set system locale'
        'list-locales:Show known locales'
        'set-keymap:Set virtual console keyboard mapping'
        'list-keymaps:Show known virtual console keyboard mappings'
        'set-x11-keymap:Set X11 keyboard mapping'
        'list-x11-keymap-models:Show known X11 keyboard mapping models'
        'list-x11-keymap-layouts:Show known X11 keyboard mapping layouts'
        'list-x11-keymap-variants:Show known X11 keyboard mapping variants'
        'list-x11-keymap-options:Show known X11 keyboard mapping options'
    )
    if (( CURRENT == 1 )); then
        _describe -t commands 'localectl command' _localectl_cmds
    else
        local curcontext="$curcontext"
        cmd="${${_localectl_cmds[(r)$words[1]:*]%%:*}}"
        if (( $+functions[_localectl_$cmd] )); then
            _localectl_$cmd
        else
            _message "unknown localectl command: $words[1]"
        fi
    fi
}

_arguments \
    {-h,--help}'[Show this help]' \
    '--version[Show package version]' \
    "--no-convert[Don't convert keyboard mappings]" \
    '--no-pager[Do not pipe output into a pager]' \
    '--no-ask-password[Do not prompt for password]' \
    {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
    {-M+,--machine=}'[Operate on local container]:machine' \
    '*::localectl commands:_localectl_commands'

Directory Contents

Dirs: 0 × Files: 28

Name Size Perms Modified Actions
2.84 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
9.36 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
6.18 KB lrw-r--r-- 2024-08-12 18:00:48
Edit Download
1.89 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
14.58 KB lrw-r--r-- 2026-01-28 08:27:23
Edit Download
20.25 KB lrw-r--r-- 2026-03-10 23:36:54
Edit Download
643 B lrw-r--r-- 2024-04-17 17:19:24
Edit Download
2.73 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
7.03 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
779 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
8.18 KB lrw-r--r-- 2021-12-13 03:43:13
Edit Download
3.68 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
6.25 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
120 B lrw-r--r-- 2026-05-05 09:12:24
Edit Download
128 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
505 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
318 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
263 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
19.50 KB lrw-r--r-- 2026-05-05 15:47:58
Edit Download
3.76 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
5.50 KB lrw-r--r-- 2026-05-05 15:44:27
Edit Download
633 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
1.15 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
330 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
4.25 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
744 B lrw-r--r-- 2022-10-31 18:59:18
Edit Download
2.00 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download
8.06 KB lrw-r--r-- 2022-10-31 18:59:18
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
 !"#$%&'(()*+,-./00123456789 t\ wIDATx ]ys  47Y ƒ -  "  Rv  < f{Ɛ $k l L > L  ~h^ 1  [  r G t& h  l F z3O Y ! p A(_g̷ E8 )S 8 c  Kb"z ~ 5 J xAL WU <  *  5 m;W a pB h ~P J 2 3 6 ҙ .Ƹ P i  4g F R L P ΪK/D  M v (a3 k J Œ4N5* SH ` SdJ z  O J Xՠ V>u ߱ BE&L b2 ?2` tX+  c CB A$ i b C ĀMB E : /  # Dx &l =q Ty  0 \p I ( L Ǎ { e 4k ;`u^ヲ eP!( d {  )T A 8 O;Ě n >;s6 !  :Nx `[S D HU ~ q›J F} a g*D 49 / pn k h (t 8NxƐF _!r չ7 ZR R׷ q/5") Ӎ NY 0 x sZ!   o  fu  ,  K"$ ? pg  㕣=  1» {h " fh7    y  } € +7  $ y " X —ą - G P u 4 m >J 5 L =V ' ^@I p ?MS xЌ XV P ! h "C NS9B8̢ ]!K  e   zA , ӏkbY  !< XQ ٿyS| *" f { w  4@[S <  # 0 ! js [m  =,~ o "ݎ DHf Wo $ g ! Vԅ t mB /y Wf V4񺍸 c+@x?  B ~u " xUN e 0 BĂ) ~J pz! 7y6]l Ԥ@ P a< O /DHC `≻  N m"$  0ObB }{ x AO FCG D R ^ "B  { WDH  UR l@ T #  +"d T ; 0 i  D}. 7 ` ' ] w rE &S i ƕiTD EL P _ u h $ Ա FG wVD G L R Zf ' .!] J /ZR oGЍs Mr Ĥ ʬ 3 Q [3 cL ` ^ p + ( F;# B 5 '  2Y f [  ϶R0e }  E 7 6M aۮ H <& n % L] E}Up x紉, Uw' Q  Ǯշo k ވۙ 0N94 VX5 xEDE l D #֤ } C o )W :  ^ s 9  bRf iX5u ཱི 4 :[  T 1. | [E 2ؽ Iy\ : o x K G 5 ylP ' uK E ftb/i[3 .g _  [3M n G, #NwQ5~  ؚ) | n =Ц"x qg gB ` 듘 ~ x w ? ? R~  _ u. &VQ K˻   H C ( TN˄+ `C dA nB׭ D 3"Z G ê ^k H_ /- ~ " R_  .8 Z_ 6@ o  xg  uP ? 3լ @7AM!  E7^ - =V L  x  g-D0  CtmW 7  O  G _ WD0 g C  w1 r d w : a | \  *" f nֳ ^ H# f L ` Z ۽hV  }S F r0Ù Bć5r] @! NL iQ]{s^=4 d  WD  "  "   M; t" 8 5 e dL| "-*st" ) SWD ?R[S e ooF  20.D ? bo =) A i o d ģ ZҰaO @E =) i D a &ܟa CϞ y6 ,<%{^x%{f8? `iw^ ?/ M * IEND B`