令和SECCONに参加するのでTSURUGI Linuxを入れてみました。
fluxboxに切り替えて「fbmenugen」を使ったら「Other」に「TSURUGI」メニューが全て入ってカテゴリが分からなくなってしまいました。 仕方がないのでpythonでmateからfluxboxの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(...)}, PR |
令和SECCONに出場するのですね!
応援してます。 がんばってください。 野郎から応援もらっても嬉しくはないか( ̄。 ̄; |
ゼンガイチさんもぜひ参加してみては?
意外と楽しいですよ。(^^)/
【2019/04/26 20:10】| | nwpfh #990cd0fa21 [ 編集 ]
|
結果はどうでしたか?
(⌒_⌒)/ |
難しいっすw 2時間とか短過ぎ。最初は繋がらなくって、運営が延長してました(笑)
【2019/05/01 10:56】| | nwpfh #990cd0fa21 [ 編集 ]
|
XOR
- Moderator - ": Вас приветствует абсолютно новая версия даркнет платформы Мега онион – в данный момент самый перспективный ресурс русского интернета! Ссылка для доступа через обычный браузер на зеркало сайта Мега – https://xn--mga-kra.com - Вам больше нет надобности искать все новые зеркала гидры, потому что теперь ты знаешь, где найти самый топовый товар и по самым вкусным ценам. Быстрый и моментальный доступ, манящий и приветливый дизайн сайта, в котором молнейностно и приятно возможно приобрести все самое нужное тебе в данный момент. |
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… |
Moderator - Nice Article! XOR read this
показать фаллоимитаторы: https://pornopda.xyz/shop/seks_igrushki/falloimitatori/ – возможность узнать больше о разнообразии товаров и принять правильное решение. |
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 [ 編集 ]
|
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] |