忍者ブログ
  • 2024.03«
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • » 2024.05
[PR]
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

【2024/04/26 07:13 】 |
TSURUGIを入れてみた
令和SECCONに参加するのでTSURUGI Linuxを入れてみました。

fluxboxに切り替えて「fbmenugen」を使ったら「Other」に「TSURUGI」メニューが全て入ってカテゴリが分からなくなってしまいました。
fluxboxを入れた直後
仕方がないのでpythonでmateからfluxboxのmenuに変換するプログラムを作成、すっきりしましたとさ。
menuを修正後
■変換用python
import sys
from xml.dom import minidom
from os import path
from collections import OrderedDict

APP_Directory = None
DIR_Directory = None
def main():
    global APP_Directory
    global DIR_Directory

    if len(sys.argv)!=2:
        print("Using: {} mate.conf".format(sys.argv[0]))
        return
    fileName = sys.argv[1]
    APP_Directory = path.abspath(path.dirname(fileName)+"/../applications")
    DIR_Directory = path.abspath(path.dirname(fileName)+"/../desktop-directories")
    print(fileName)

    with open(fileName, "r", True, "UTF-8") as r:
        x = "\n".join(r.readlines())
    myDom = minidom.parseString(x)
    
    recurseDict(myDom, 0, [])

def recurseDict(dic, layer, stack):
    #dic = minidom.parseString("")
    layer+=1
    if sum(1 for x in dic.childNodes if not isinstance(x, minidom.Text)):
        if dic.nodeName != "Layout":
            for d in dic.childNodes:
                if not isinstance(d, minidom.Text):
                    recurseDict(d, layer, stack)

    else:
        if dic.nodeName == "Directory":
            lidx = 0
            for lidx in range(len(stack), 0, -1):
                if layer > stack[lidx-1][0]:
                    break
            for _ in range(lidx, len(stack)):
                stack.pop()
                print("{}[end]".format(" "*(len(stack)*2)))
            
            v = readFile(DIR_Directory+"/"+dic.childNodes[0].nodeValue)
            print("{}[submenu] ({}) <{}>".format(" "*(len(stack)*2), v["Name"], v["Icon"]))
            stack.append((layer, v))

        if dic.nodeName == "Filename":
            v = readFile(APP_Directory+"/"+dic.childNodes[0].nodeValue)
            print("{}[exec] ({}) {{{}}} <{}>".format(" "*(len(stack)*2), v["Name"], v["Exec"], v["Icon"]))

    if layer==1:
        for _ in range(len(stack)):
            stack.pop()
            print("{}[end]".format(" "*(len(stack)*2)))

def readFile(fileName):
    with open(fileName, "r", True, "UTF-8") as r:
        rec=dict()
        while True:            
            line = r.readline()
            if line=="":
                break
            line = line[:-1]

            pos = line.find("=")
            if pos >=0:
                key = line[0:pos]

                if ["Icon", "Name", "Exec"].count(key):
                    rec[key] = line[pos+1:]

        return rec


if __name__ == "__main__":
    main()
■fbmenugenにinclude機能を追加
diff --git a/fbmenugen b/fbmenugen
index 84e268b..fa5e784 100755
--- a/fbmenugen
+++ b/fbmenugen
@@ -401,6 +401,14 @@ ITEM_WITH_ICON
 ITEM
 }

+sub prepare_include {
+    my $path= shift() =~ s/\)/\\)/gr;
+
+    return <<"EOF"
+  [include] ($path)
+EOF
+}
+
 sub begin_category {
     $with_icons
       ? <<"MENU_WITH_ICON"
@@ -479,6 +487,9 @@ foreach my $schema (@$SCHEMA) {
     elsif (exists $schema->{item}) {
         $generated_menu .= prepare_item(@{$schema->{item}});
     }
+    elsif (exists $schema->{include}) {
+        $generated_menu .= prepare_include(@{$schema->{include}});
+    }
     elsif (exists $schema->{sep}) {
         $generated_menu .= "[separator]\n";
     }
diff --git a/schema.pl b/schema.pl
index 18a824a..50ae0dd 100644
--- a/schema.pl
+++ b/schema.pl
@@ -5,6 +5,7 @@
 =for comment

     item:      add an item inside the menu               {item => ["command", "label", "icon"]},
+    include:   add include another file               {include => ["path"]},
     cat:       add a category inside the menu             {cat => ["name", "label", "icon"]},
     sep:       horizontal line separator                  {sep => undef}, {sep => "label"},
     raw:       any valid Fluxbox menu entry               {raw => q(...)},

拍手[0回]

PR
【2019/04/25 22:29 】 | linux | 有り難いご意見(9)
<<SECCON令和に参加してみました | ホーム | UbuntuでCUPSを用いて自動命名印刷>>
有り難いご意見
無題
令和SECCONに出場するのですね!
応援してます。
がんばってください。
野郎から応援もらっても嬉しくはないか( ̄。 ̄;
【2019/04/26 20:05】| URL | ゼンガイチ #9b127fad8d [ 編集 ]


無題
ゼンガイチさんもぜひ参加してみては?
意外と楽しいですよ。(^^)/
【2019/04/26 20:10】| | nwpfh #990cd0fa21 [ 編集 ]


無題
結果はどうでしたか?

        (⌒_⌒)/
【2019/05/01 10:04】| URL | ゼンガイチ #9b127fad8d [ 編集 ]


無題
難しいっすw 2時間とか短過ぎ。最初は繋がらなくって、運営が延長してました(笑)
【2019/05/01 10:56】| | nwpfh #990cd0fa21 [ 編集 ]


сайт мега даркнет
XOR
-
Moderator - ":

Вас приветствует абсолютно новая версия даркнет платформы Мега онион – в данный момент самый перспективный ресурс русского интернета! Ссылка для доступа через обычный браузер на зеркало сайта Мега – https://xn--mga-kra.com - Вам больше нет надобности искать все новые зеркала гидры, потому что теперь ты знаешь, где найти самый топовый товар и по самым вкусным ценам. Быстрый и моментальный доступ, манящий и приветливый дизайн сайта, в котором молнейностно и приятно возможно приобрести все самое нужное тебе в данный момент.
【2022/09/27 16:23】| URL | Rositasap #3fb51a5774 [ 編集 ]


無題
I want to to thank you for this fantastic read!!

I absolutely loved every bit of it. I've got you book marked to look at new
things you post…
【2023/04/20 09:54】| URL | KINOGO #6607628fc3 [ 編集 ]


купить двойной вибратор
Moderator - Nice Article! XOR read this
показать фаллоимитаторы: https://pornopda.xyz/shop/seks_igrushki/falloimitatori/
– возможность узнать больше о разнообразии товаров и принять правильное решение.
【2023/07/17 18:08】| URL | BruceAlbup #385976c57 [ 編集 ]


https://goo.su/ZUHZ
Hello dear friend, I would like to offer placement of your link (or links) on different platforms of the internet such as: forums, blogs, comments and much more. . .

Increase your Visibility Boost Your Seo Rank - Get Organic Traffic From Google. Ranking in Google isn’t hard. All you need is a healthy number of backlinks from referring domains that have authority and trust in Google’s eyes.

This Backlinks Service Benefits:

1. Easily get Google rankings

2. Get a lot of traffic from Google

3. You can earn from the website in different ways

4. Increase Domain Authority (DA)

Quality guaranteed !

PRICE - 20$

WebSite - https://goo.su/ZUHZ
【2024/03/29 13:10】| | RobertImise #681966a4c9 [ 編集 ]


https://goo.su/CHM5cJW
Hello dear friend, I would like to offer placement of your link (or links) on different platforms of the internet such as: forums, blogs, comments and much more. . .

Increase your Visibility Boost Your Seo Rank - Get Organic Traffic From Google. Ranking in Google isn’t hard. All you need is a healthy number of backlinks from referring domains that have authority and trust in Google’s eyes.

This Backlinks Service Benefits:

1. Easily get Google rankings

2. Get a lot of traffic from Google

3. You can earn from the website in different ways

4. Increase Domain Authority (DA)

Quality guaranteed !

PRICE - 20$

WebSite - https://goo.su/CHM5cJW
【2024/04/22 23:09】| | EugeneUnigh #1f7bdc41c4 [ 編集 ]


貴重なご意見の投稿















前ページ | ホーム | 次ページ

忍者ブログ [PR]