Почему у меня есть двоение и разрыв с i3 менеджером окон, соединенным с xcompgmr при мозаичном размещении терминалов вертикально?

Для преобразования от символьного до восьмеричной нотации я однажды придумал:

chmod_format() {
  sed 's/.\(.........\).*/\1/
    h;y/rwsxtSTlL-/IIIIIOOOOO/;x;s/..\(.\)..\(.\)..\(.\)/|\1\2\3/
    y/sStTlLx-/IIIIIIOO/;G
    s/\n\(.*\)/\1;OOO0OOI1OIO2OII3IOO4IOI5IIO6III7/;:k
    s/|\(...\)\(.*;.*\1\(.\)\)/\3|\2/;tk
    s/^0*\(..*\)|.*/\1/;q'
}

Расширенный:

#! /bin/sed -f
s/.\(.........\).*/\1/; # extract permissions and discard the rest

h; # store a copy on the hold space

# Now for the 3 lowest octal digits (rwx), translates the flags to
# binary where O means 0 and I means 1.
# l, L are for mandatory locking (a regular file that has 02000 on
# and not 010 on some systems like Linux). Some ls implementations
# like GNU ls confusingly use S there like for directories even though 
# it has nothing to do with setgid in that case. Some ls implementations 
# use L, some others l (against POSIX which requires an uppercase
# flag for extra flags when the execution bit is not set).
y/rwsxtSTlL-/IIIIIOOOOO/

x; # swap hold and pattern space, to do a second processing on those flags.

# now only consider the "xXlLsStT" bits:
s/..\(.\)..\(.\)..\(.\)/|\1\2\3/

y/sStTlLx-/IIIIIIOO/; # make up the 4th octal digit as binary like before

G; # append the hold space so we now have all 4 octal digits as binary

# remove the extra newline and append a translation table
s/\n\(.*\)/\1;OOO0OOI1OIO2OII3IOO4IOI5IIO6III7/

:k
  # translate the OOO -> 0 ... III -> 7 in a loop
  s/|\(...\)\(.*;.*\1\(.\)\)/\3|\2/
tk

# trim leading 0s and our translation table.
s/^0*\(..*\)|.*/\1/;q

Это возвращает восьмеричное число из вывода ls -l на одном файле.

$ echo 'drwSr-sr-T' | chmod_format
7654

10
13.06.2014, 15:03
1 ответ
[

]Симптомы возникают из []двух [] различных вопросов здесь: [

] [
    ] [
  1. ][

    ]композитор []композитор[]: используйте в данном случае что-то более свежее, например Compton, со следующими последними вариантами, если они поддерживаются вашим оборудованием:[

    ] [
    ][]exec --no-startup-id compton -cCGb --backend glx --vsync opengl
    [][
    ][
  2. ] [
  3. ][

    ] Тот факт, что композиторы [][] официально не поддерживаются [][] этим оконным менеджером и [] потому, что [] способ, которым i3 визуализирует заголовки окон. Известным обходным путем является отключение таких заголовочных баров путем добавления в []~/.i3/config[]:[

    ] [
    ][]new_window pixel
    [][
    ][
  4. ] [
] [

]Для перемещения по плавающему окну без заголовка используйте []mod+drag[] в любом месте на нем. Наконец, часть этого может измениться со временем [][].[

].
11
27.01.2020, 20:02

Теги

Похожие вопросы