From: Niki Roo Date: Fri, 28 Feb 2025 12:32:21 +0000 (+0100) Subject: Auto commit 2025-02-28 13:32 X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=8282b241103eaeaaef0be2497b7e16855943b8f0;p=notes.git Auto commit 2025-02-28 13:32 --- diff --git a/404.html b/404.html index 647bd03..4508a32 100644 --- a/404.html +++ b/404.html @@ -604,7 +604,7 @@ - Linux display + Linux display scaling @@ -625,7 +625,7 @@ - Ssh + SSH @@ -646,7 +646,7 @@ - Web css + Web CSS @@ -702,7 +702,7 @@ - README + MHS 3.5 Inch Display @@ -783,11 +783,11 @@
  • - + - Docker + README @@ -804,11 +804,11 @@
  • - + - Force X11 + Docker @@ -825,11 +825,11 @@
  • - + - Game Mode + Force X11 @@ -846,11 +846,11 @@
  • - + - Linux display + Game Mode diff --git a/History/Ancient Rome/Waking up/index.html b/History/Ancient Rome/Waking up/index.html index 4048d20..8da1874 100644 --- a/History/Ancient Rome/Waking up/index.html +++ b/History/Ancient Rome/Waking up/index.html @@ -705,7 +705,7 @@ - Linux display + Linux display scaling @@ -726,7 +726,7 @@ - Ssh + SSH @@ -747,7 +747,7 @@ - Web css + Web CSS @@ -803,7 +803,7 @@ - README + MHS 3.5 Inch Display @@ -884,11 +884,11 @@
  • - + - Docker + README @@ -905,11 +905,11 @@
  • - + - Force X11 + Docker @@ -926,11 +926,11 @@
  • - + - Game Mode + Force X11 @@ -947,11 +947,11 @@
  • - + - Linux display + Game Mode diff --git a/Phone/Framagenda/index.html b/Phone/Framagenda/index.html index 5270c3b..eb197a0 100644 --- a/Phone/Framagenda/index.html +++ b/Phone/Framagenda/index.html @@ -625,7 +625,7 @@ - Linux display + Linux display scaling @@ -646,7 +646,7 @@ - Ssh + SSH @@ -667,7 +667,7 @@ - Web css + Web CSS @@ -723,7 +723,7 @@ - README + MHS 3.5 Inch Display @@ -804,11 +804,11 @@
  • - + - Docker + README @@ -825,11 +825,11 @@
  • - + - Force X11 + Docker @@ -846,11 +846,11 @@
  • - + - Game Mode + Force X11 @@ -867,11 +867,11 @@
  • - + - Linux display + Game Mode diff --git a/Politique/Le droit d'asile pour les nuls/index.html b/Politique/Le droit d'asile pour les nuls/index.html index 5bef88f..3146745 100644 --- a/Politique/Le droit d'asile pour les nuls/index.html +++ b/Politique/Le droit d'asile pour les nuls/index.html @@ -763,7 +763,7 @@ - Linux display + Linux display scaling @@ -784,7 +784,7 @@ - Ssh + SSH @@ -805,7 +805,7 @@ - Web css + Web CSS @@ -861,7 +861,7 @@ - README + MHS 3.5 Inch Display @@ -942,11 +942,11 @@
  • - + - Docker + README @@ -963,11 +963,11 @@
  • - + - Force X11 + Docker @@ -984,11 +984,11 @@
  • - + - Game Mode + Force X11 @@ -1005,11 +1005,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/Raspi/MHS 3.5 Inch Display/index.html b/Tech/Raspi/MHS 3.5 Inch Display/index.html index 95d2996..bb919fb 100644 --- a/Tech/Raspi/MHS 3.5 Inch Display/index.html +++ b/Tech/Raspi/MHS 3.5 Inch Display/index.html @@ -20,7 +20,7 @@ - README - Niki's Doc + MHS 3.5 Inch Display - Niki's Doc @@ -62,7 +62,7 @@
    - + Skip to content @@ -98,7 +98,7 @@
    - README + MHS 3.5 Inch Display
    @@ -615,7 +615,7 @@ - Linux display + Linux display scaling @@ -636,7 +636,7 @@ - Ssh + SSH @@ -657,7 +657,7 @@ - Web css + Web CSS @@ -724,7 +724,7 @@ - README + MHS 3.5 Inch Display @@ -735,7 +735,7 @@ - README + MHS 3.5 Inch Display @@ -854,11 +854,11 @@
  • - + - Docker + README @@ -875,11 +875,11 @@
  • - + - Force X11 + Docker @@ -896,11 +896,11 @@
  • - + - Game Mode + Force X11 @@ -917,11 +917,11 @@
  • - + - Linux display + Game Mode @@ -1005,7 +1005,7 @@ -

    README

    +

    MHS 3.5 Inch Display

    git clone https://github.com/goodtft/LCD-show.git cd LCD-show sudo ./MHS35-show

    diff --git a/Tech/Raspi/info/index.html b/Tech/Raspi/info/index.html index e4861d5..b7995f4 100644 --- a/Tech/Raspi/info/index.html +++ b/Tech/Raspi/info/index.html @@ -12,7 +12,7 @@ - + @@ -615,7 +615,7 @@ - Linux display + Linux display scaling @@ -636,7 +636,7 @@ - Ssh + SSH @@ -657,7 +657,7 @@ - Web css + Web CSS @@ -715,7 +715,7 @@ - README + MHS 3.5 Inch Display @@ -806,11 +806,11 @@
  • - + - Docker + README @@ -827,11 +827,11 @@
  • - + - Force X11 + Docker @@ -848,11 +848,11 @@
  • - + - Game Mode + Force X11 @@ -869,11 +869,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/SteamDeck/docker/index.html b/Tech/SteamDeck/docker/index.html index de20ecf..85d17de 100644 --- a/Tech/SteamDeck/docker/index.html +++ b/Tech/SteamDeck/docker/index.html @@ -9,7 +9,7 @@ - + @@ -615,7 +615,7 @@ - Linux display + Linux display scaling @@ -636,7 +636,7 @@ - Ssh + SSH @@ -657,7 +657,7 @@ - Web css + Web CSS @@ -713,7 +713,7 @@ - README + MHS 3.5 Inch Display @@ -793,28 +793,18 @@ - - -
  • - - - - - - - - +
  • + - Docker + README -
  • @@ -824,18 +814,28 @@ + -
  • - + +
  • + + + + + + + + - Force X11 + Docker +
  • @@ -848,11 +848,11 @@
  • - + - Game Mode + Force X11 @@ -869,11 +869,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/SteamDeck/force-x11/index.html b/Tech/SteamDeck/force-x11/index.html index 988bb69..45645b5 100644 --- a/Tech/SteamDeck/force-x11/index.html +++ b/Tech/SteamDeck/force-x11/index.html @@ -615,7 +615,7 @@ - Linux display + Linux display scaling @@ -636,7 +636,7 @@ - Ssh + SSH @@ -657,7 +657,7 @@ - Web css + Web CSS @@ -713,7 +713,7 @@ - README + MHS 3.5 Inch Display @@ -796,11 +796,11 @@
  • - + - Docker + README @@ -814,28 +814,18 @@ - - -
  • - - - - - - - - +
  • + - Force X11 + Docker -
  • @@ -845,18 +835,28 @@ + -
  • - + +
  • + + + + + + + + - Game Mode + Force X11 +
  • @@ -869,11 +869,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/SteamDeck/game-mode/index.html b/Tech/SteamDeck/game-mode/index.html index 2ef982d..27cd5eb 100644 --- a/Tech/SteamDeck/game-mode/index.html +++ b/Tech/SteamDeck/game-mode/index.html @@ -12,8 +12,6 @@ - - @@ -615,7 +613,7 @@ - Linux display + Linux display scaling @@ -636,7 +634,7 @@ - Ssh + SSH @@ -657,7 +655,7 @@ - Web css + Web CSS @@ -713,7 +711,7 @@ - README + MHS 3.5 Inch Display @@ -795,6 +793,27 @@ +
  • + + + + + README + + + + +
  • + + + + + + + + + +
  • @@ -910,27 +929,6 @@ - - - - - - -
  • - - - - - Linux display - - - - -
  • - - - - diff --git a/Tech/SteamDeck/scaling/index.html b/Tech/SteamDeck/index.html similarity index 53% rename from Tech/SteamDeck/scaling/index.html rename to Tech/SteamDeck/index.html index 8bcafbc..3cacf01 100644 --- a/Tech/SteamDeck/scaling/index.html +++ b/Tech/SteamDeck/index.html @@ -9,20 +9,22 @@ - + + - + + - Linux display - Niki's Doc + README - Niki's Doc - + @@ -36,12 +38,12 @@ - + - + @@ -60,7 +62,7 @@
    - + Skip to content @@ -76,7 +78,7 @@
    @@ -1075,121 +931,12 @@ -

    Linux display

    -

    This iis detailed in depth on how does Linux's display works? QA.

    -

    On most desktops system (like KDE or Gnome) there are settings available on their respective settings panel, this guide is for additional/manual settings that can be applied to scale an application or the whole desktop. This reference article have many valuable informations for the matter.

    -

    Scaling applications

    -

    Scaling application can be done mainly via DPI, specific environment variable (explained bellow), application own setting or some specific desktop setting (out of scope of this QA).

    - -
        export QT_AUTO_SCREEN_SET_FACTOR=0
    -    export QT_SCALE_FACTOR=2
    -    export QT_FONT_DPI=96
    -
    - -
        export GDK_SCALE=2
    -    export GDK_DPI_SCALE=0.5
    -
    - -
        gsettings set org.gnome.desktop.interface text-scaling-factor 2.0 
    -
    - -
        chromium --high-dpi-support=1 --force-device-scale-factor=1.5
    -
    - -

    Scaling the desktop with Xorg X11

    -

    Xorg's extension RandR have a scaling feature and can be configured with xrandr. This can be used to scale the desktop to display a bigger environment, this can be useful for HiDPI (High Dots Per Inch) displays.

    -

    RandR can also be used the other way around, example making a screen with 1366x768 max resolution support a greater resolution like 1920x1080. This is achieved by simulating the new greater resolution while rendering it for the supported max resolution, similar to when we watch a Full-HD video on a screen that is not Full-HD.

    -

    Scaling the desktop without changing the resolution

    - -
        xrandr | grep connected | grep -v disconnected | awk '{print $1}'
    -
    - -
        xrandr --output screen-name --scale 0.8x0.8
    -
    - -
        xrandr --output screen-name --scale 1.2x1.2
    -
    - -
        xrandr --output screen-name --scale 1x1
    -
    -

    Scaling the desktop and simulate/render a new resolution

    -

    When using xrandr to "zoom-in" with the previous method, the desktop remain full screen but when we "zoom-out" with for instance xrandr --output screen-name --scale 1.2x1.2 (to get an unsupported resolution) the desktop is not displayed in full screen because this require updating the resolution (to probably a higher unsupported resolution by the screen), we can use a combinaison of --mode, --panning and --scale, xrandr's parameters to achieve a full screen "zoom-out" scaling (simulate a new resolution), example:

    +

    README

    +

    Some scripts are also present here:

    -
        xdpyinfo | grep -B 2 resolution
    -    # or
    -    xdpyinfo
    -
    - -
        Scaling at:                      120%
    -    Used/max screen resolution:      1366 x 768
    -    Resolution at 120% (res x 1.2):  1640 x 922 (round)
    -    Scaling factor (new res / res):  1.20058565 x 1.20208604 
    -
    - -
        xrandr --output screen-name --mode 1366x768 --panning 1640x922 --scale 1.20058565x1.20208604
    -
    - -
        xrandr --output screen-name --mode 1366x768 --panning 1366x768 --scale 1x1
    -
    -    # restarting the desktop may be required example with KDE
    -    # kquitapp5 plasmashell
    -    # plasmashell &
    -
    -

    Making xrandr changes persistent

    -

    There is a multitude of methods to make xrandr changes persistent, this and this QA have many examples.

    -

    Experiments notes

    -

    As a side note and experiments result while using SDDM + KDE, and after many tests to achieve a persistent config, I ended up loading a script with ~/.config/autostart (systemsettings5 > Startup... > Autostart), and naming my script 00-scriptname to make it run first.

    -
    # 00-scriptname
    -
    -# Applying the main xrandr suited changes (scaling at x1.15)
    -
    -xrandr --output eDP1 --mode 1366x768 --panning 1574x886 --scale 1.15226939x1.15364583
    -
    -# This is where it get odd/complicated, sometimes the screen resolution is not applied correctly or not applied at all... 
    -# Note that "xrandr --fb" can be used alone to change the screen resolution on a normal situation... 
    -# Here we will be taking advantage of xrandr's "--fb" feature to make the config appliance stable and works every-time.
    -
    -# The odd thing here is while re-applying the new resolution 1574x886 with "--fb" nothing happen, but 
    -# if we use use an unsupported resolution like 1574x884 (vs 1574x886) then xrandr force the resolution 
    -# to "reset itself" to the configured resolution (1574x886)... 
    -
    -# In short just re-apply the setting with "--fb" and an unsupported resolution to force a reset.
    -# ("--fb" can be used alone here without re-applying everything)
    -
    -#xrandr --fb 1574x884 
    -xrandr --fb 1574x884 --output eDP1 --mode 1366x768 --panning 1574x886 --scale 1.15226939x1.15364583
    -
    @@ -1236,12 +983,12 @@ xrandr --fb 1574x884 --output eDP1 --mode 1366x768 --panning 1574x886 --scale 1. - + - + - + diff --git a/Tech/bash/index.html b/Tech/bash/index.html index a75f866..6ed6328 100644 --- a/Tech/bash/index.html +++ b/Tech/bash/index.html @@ -682,7 +682,7 @@ - Linux display + Linux display scaling @@ -703,7 +703,7 @@ - Ssh + SSH @@ -724,7 +724,7 @@ - Web css + Web CSS @@ -780,7 +780,7 @@ - README + MHS 3.5 Inch Display @@ -861,11 +861,11 @@
  • - + - Docker + README @@ -882,11 +882,11 @@
  • - + - Force X11 + Docker @@ -903,11 +903,11 @@
  • - + - Game Mode + Force X11 @@ -924,11 +924,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/color-theme/index.html b/Tech/color-theme/index.html index c6ff845..4e4691b 100644 --- a/Tech/color-theme/index.html +++ b/Tech/color-theme/index.html @@ -688,7 +688,7 @@ - Linux display + Linux display scaling @@ -709,7 +709,7 @@ - Ssh + SSH @@ -730,7 +730,7 @@ - Web css + Web CSS @@ -786,7 +786,7 @@ - README + MHS 3.5 Inch Display @@ -867,11 +867,11 @@
  • - + - Docker + README @@ -888,11 +888,11 @@
  • - + - Force X11 + Docker @@ -909,11 +909,11 @@
  • - + - Game Mode + Force X11 @@ -930,11 +930,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/docker/index.html b/Tech/docker/index.html index 036840e..40b48ef 100644 --- a/Tech/docker/index.html +++ b/Tech/docker/index.html @@ -625,7 +625,7 @@ - Linux display + Linux display scaling @@ -646,7 +646,7 @@ - Ssh + SSH @@ -667,7 +667,7 @@ - Web css + Web CSS @@ -723,7 +723,7 @@ - README + MHS 3.5 Inch Display @@ -804,11 +804,11 @@
  • - + - Docker + README @@ -825,11 +825,11 @@
  • - + - Force X11 + Docker @@ -846,11 +846,11 @@
  • - + - Game Mode + Force X11 @@ -867,11 +867,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/dosbox/index.html b/Tech/dosbox/index.html index ffeb751..a803f39 100644 --- a/Tech/dosbox/index.html +++ b/Tech/dosbox/index.html @@ -625,7 +625,7 @@ - Linux display + Linux display scaling @@ -646,7 +646,7 @@ - Ssh + SSH @@ -667,7 +667,7 @@ - Web css + Web CSS @@ -723,7 +723,7 @@ - README + MHS 3.5 Inch Display @@ -804,11 +804,11 @@
  • - + - Docker + README @@ -825,11 +825,11 @@
  • - + - Force X11 + Docker @@ -846,11 +846,11 @@
  • - + - Game Mode + Force X11 @@ -867,11 +867,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/firefox/index.html b/Tech/firefox/index.html index eb66665..6b89c47 100644 --- a/Tech/firefox/index.html +++ b/Tech/firefox/index.html @@ -715,7 +715,7 @@ - Linux display + Linux display scaling @@ -736,7 +736,7 @@ - Ssh + SSH @@ -757,7 +757,7 @@ - Web css + Web CSS @@ -813,7 +813,7 @@ - README + MHS 3.5 Inch Display @@ -894,11 +894,11 @@
  • - + - Docker + README @@ -915,11 +915,11 @@
  • - + - Force X11 + Docker @@ -936,11 +936,11 @@
  • - + - Game Mode + Force X11 @@ -957,11 +957,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/git/index.html b/Tech/git/index.html index 1232c69..bfa98f5 100644 --- a/Tech/git/index.html +++ b/Tech/git/index.html @@ -664,7 +664,7 @@ - Linux display + Linux display scaling @@ -685,7 +685,7 @@ - Ssh + SSH @@ -706,7 +706,7 @@ - Web css + Web CSS @@ -762,7 +762,7 @@ - README + MHS 3.5 Inch Display @@ -843,11 +843,11 @@
  • - + - Docker + README @@ -864,11 +864,11 @@
  • - + - Force X11 + Docker @@ -885,11 +885,11 @@
  • - + - Game Mode + Force X11 @@ -906,11 +906,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/mp4/index.html b/Tech/mp4/index.html index 165b8fc..928df65 100644 --- a/Tech/mp4/index.html +++ b/Tech/mp4/index.html @@ -814,7 +814,7 @@ - Linux display + Linux display scaling @@ -835,7 +835,7 @@ - Ssh + SSH @@ -856,7 +856,7 @@ - Web css + Web CSS @@ -912,7 +912,7 @@ - README + MHS 3.5 Inch Display @@ -993,11 +993,11 @@
  • - + - Docker + README @@ -1014,11 +1014,11 @@
  • - + - Force X11 + Docker @@ -1035,11 +1035,11 @@
  • - + - Game Mode + Force X11 @@ -1056,11 +1056,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/qemu/index.html b/Tech/qemu/index.html index a1948a8..f00d9c9 100644 --- a/Tech/qemu/index.html +++ b/Tech/qemu/index.html @@ -730,7 +730,7 @@ - Linux display + Linux display scaling @@ -751,7 +751,7 @@ - Ssh + SSH @@ -772,7 +772,7 @@ - Web css + Web CSS @@ -828,7 +828,7 @@ - README + MHS 3.5 Inch Display @@ -909,11 +909,11 @@
  • - + - Docker + README @@ -930,11 +930,11 @@
  • - + - Force X11 + Docker @@ -951,11 +951,11 @@
  • - + - Game Mode + Force X11 @@ -972,11 +972,11 @@
  • - + - Linux display + Game Mode diff --git a/Tech/scaling/index.html b/Tech/scaling/index.html index 6f8934c..7a048c0 100644 --- a/Tech/scaling/index.html +++ b/Tech/scaling/index.html @@ -20,7 +20,7 @@ - Linux display - Niki's Doc + Linux display scaling - Niki's Doc @@ -62,7 +62,7 @@
    - + Skip to content @@ -98,7 +98,7 @@
    - Linux display + Linux display scaling
    @@ -624,7 +624,7 @@ - Linux display + Linux display scaling @@ -635,7 +635,7 @@ - Linux display + Linux display scaling @@ -730,7 +730,7 @@ - Ssh + SSH @@ -751,7 +751,7 @@ - Web css + Web CSS @@ -807,7 +807,7 @@ - README + MHS 3.5 Inch Display @@ -888,11 +888,11 @@
  • - + - Docker + README @@ -909,11 +909,11 @@
  • - + - Force X11 + Docker @@ -930,11 +930,11 @@
  • - + - Game Mode + Force X11 @@ -951,11 +951,11 @@
  • - + - Linux display + Game Mode @@ -1075,8 +1075,8 @@ -

    Linux display

    -

    This iis detailed in depth on how does Linux's display works? QA.

    +

    Linux display scaling

    +

    This is detailed in depth on how does Linux's display works? QA.

    On most desktops system (like KDE or Gnome) there are settings available on their respective settings panel, this guide is for additional/manual settings that can be applied to scale an application or the whole desktop. This reference article have many valuable informations for the matter.

    Scaling applications

    Scaling application can be done mainly via DPI, specific environment variable (explained bellow), application own setting or some specific desktop setting (out of scope of this QA).

    diff --git a/Tech/ssh/index.html b/Tech/ssh/index.html index fd96cd9..a209b0f 100644 --- a/Tech/ssh/index.html +++ b/Tech/ssh/index.html @@ -20,7 +20,7 @@ - Ssh - Niki's Doc + SSH - Niki's Doc @@ -61,6 +61,11 @@
    + + + Skip to content + +
    @@ -93,7 +98,7 @@
    - Ssh + SSH
    @@ -610,7 +615,7 @@ - Linux display + Linux display scaling @@ -633,12 +638,14 @@ + + - Ssh + SSH @@ -660,7 +667,7 @@ - Web css + Web CSS @@ -716,7 +723,7 @@ - README + MHS 3.5 Inch Display @@ -797,11 +804,11 @@
  • - + - Docker + README @@ -818,11 +825,11 @@
  • - + - Force X11 + Docker @@ -839,11 +846,11 @@
  • - + - Game Mode + Force X11 @@ -860,11 +867,11 @@
  • - + - Linux display + Game Mode @@ -906,6 +913,8 @@ + + @@ -920,8 +929,7 @@ -

    Ssh

    - +

    SSH

    cat id_rsa.ssh id_rsa.x509.pub > id_rsa.pem

    note: PEM = ssh (priv) + x509 (pub) note: x509 = crt diff --git a/Tech/web-css/index.html b/Tech/web-css/index.html index acfedac..73eddf9 100644 --- a/Tech/web-css/index.html +++ b/Tech/web-css/index.html @@ -20,7 +20,7 @@ - Web css - Niki's Doc + Web CSS - Niki's Doc @@ -62,7 +62,7 @@

    - + Skip to content @@ -98,7 +98,7 @@
    - Web css + Web CSS
    @@ -615,7 +615,7 @@ - Linux display + Linux display scaling @@ -636,7 +636,7 @@ - Ssh + SSH @@ -659,12 +659,14 @@ + +
  • - + - Docker + README @@ -875,11 +864,11 @@
  • - + - Force X11 + Docker @@ -896,11 +885,11 @@
  • - + - Game Mode + Force X11 @@ -917,11 +906,11 @@
  • - + - Linux display + Game Mode @@ -963,6 +952,8 @@ + + @@ -1009,9 +985,7 @@ -

    Web css

    - -

    WebDev

    +

    Web CSS

    A few (already working today) somewhat new CSS thingies.

    CSS custom properties (or, "CSS Variables"):

    :root { --main-color: red; }
    @@ -1043,7 +1017,7 @@ div { & td { ... } }    /* & is required for if no other symbol   */
     @layer layer1 { ... }      /* rules           */
     @layer { ... }             /* anonymous layer */
     
    -

    Interesting future CSS

    +

    Interesting future CSS

    (Do not use, not ready yet, wait a few months/years...)

    Color mix: background-color: color-mix(in srgb, #34c9eb 100%, white); (Defaults to 50%, can be in hsl or in lab or..., works very well with custom properties.)

    diff --git a/index.html b/index.html index 782dc33..ea0ce84 100644 --- a/index.html +++ b/index.html @@ -621,7 +621,7 @@ - Linux display + Linux display scaling @@ -642,7 +642,7 @@ - Ssh + SSH @@ -663,7 +663,7 @@ - Web css + Web CSS @@ -719,7 +719,7 @@ - README + MHS 3.5 Inch Display @@ -800,11 +800,11 @@
  • - + - Docker + README @@ -821,11 +821,11 @@
  • - + - Force X11 + Docker @@ -842,11 +842,11 @@
  • - + - Game Mode + Force X11 @@ -863,11 +863,11 @@
  • - + - Linux display + Game Mode diff --git a/update-index.sh b/update-index.sh new file mode 100644 index 0000000..6979f30 --- /dev/null +++ b/update-index.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# ready to use url-link to the given file +url() { + echo "$1" | sed 's: :%20:g' | sed 's:\.md$::g' +} + +work() { + read ln || return + + title="$1" + lvl="$2" + pre="$3" + + cur_lvl=$(echo "$ln" | sed 's:[^/]::g' | wc -c) + + if [ $cur_lvl -gt $lvl ]; then + title=$(dirname "$ln") + title=$(basename "$title") + if [ "$pre" = "" ]; then + pre="*" + else + pre=" $pre" + fi + elif [ $cur_lvl -lt $lvl ]; then + pre=$(echo "$pre" | cut -c5-) + fi + + if [ "$ln" = "" ]; then + echo Some documentation: + echo + elif [ -d "$ln" ]; then + name=$(basename "$ln") + if [ -e "$ln/README.md" ]; then + echo "$pre [$name](/$(url "$ln")): " + else + echo "$pre $name:" + fi + else + name=$(basename "$ln" .md) + name=$(head -n1 "$ln" | cut -c3-) + if [ "$name" != README ]; then + echo "$pre [$name](/$(url "$ln"))" + fi + fi + + work "$title" "$cur_lvl" "$pre" +} + +cd $(dirname "$0") +find . | cut -c3- | grep -Ev '(index.md)|(^mkdocs)|(^\.)|(\.sh$)' \ + | work "" -1 "" +