{"id":320620,"date":"2021-03-31T15:01:29","date_gmt":"2021-03-31T15:01:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320620"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320620","title":{"rendered":"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f desktop-\u0444\u0430\u0439\u043b\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 GNU\/Linux \u0437\u043d\u0430\u0447\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043c\u0435\u043d\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.desktop<\/code> \u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u043a\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0445 \u043d\u0435\u0442 \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e desktop-\u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 desktop-\u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u044b nsnake:<\/p>\n<pre><code class=\"json\">[Desktop Entry] Version=1.1 Type=Application Name=nsnake GenericName=Classic snake game on the terminal NoDisplay=false\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432 \u043c\u0435\u043d\u044e Icon=nsnake Exec=nsnake Terminal=true\/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 Actions= Categories=ActionGame;Game; Keywords=snake;ncurses;textual;terminal;<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u043e \u044f \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0430\u0440\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (Name), \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (Exec) \u0438 \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u043a\u043e\u043d\u043a\u0438 (Icon). \u0415\u0441\u043b\u0438 \u0438\u043a\u043e\u043d\u043a\u0438 \u043d\u0435\u0442 \u0438 \u043d\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0435\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442 \u0438\u043a\u043e\u043d\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h2>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f <a href=\"https:\/\/github.com\/alexkdeveloper\/desktop-files-creator\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c78\/59a\/30b\/c7859a30b7e4b5665b4c65b574e31c3f.png\" width=\"400\" height=\"645\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f, \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 CREATE. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c  \u0438\u043b\u0438 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u0412 \u0445\u0438\u0434\u0435\u0440\u0431\u0430\u0440\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/.local\/share\/applications. <\/code>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430&nbsp;\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h2>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Vala \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 GNOME Builder. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0441\u0430\u043c\u0443\u044e \u0441\u0432\u0435\u0436\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0440\u0435\u0434\u044b (40.0) \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Flathub. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0435\u0449\u0435 \u0431\u0430\u0433\u043e\u0432\u0430\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0435\u043b\u0430\u043b \u0432 Glade.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u043a\u0438 \u0432 \u043f\u043e\u043b\u044f\u0445 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043a \u043d\u0438\u043c, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>directory_path <\/code>\u043f\u0443\u0442\u044c&nbsp;\u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 desktop-\u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0441\u043b\u0438 \u043f\u0430\u043f\u043a\u0430 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 CREATE, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"vala\">        button_open.clicked.connect(on_open_directory);         button_create.clicked.connect(on_create_file);         directory_path = Environment.get_home_dir()+\"\/.local\/share\/applications\";         GLib.File file = GLib.File.new_for_path(directory_path);          if(!file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f             alert(\"Error!\\nPath \"+directory_path+\" is not exists!\\nThe program will not be able to perform its functions.\");             button_create.set_sensitive(false);\/\/\u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 CREATE            }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 CREATE \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>on_create_file:<\/code><\/p>\n<pre><code class=\"vala\">private void on_create_file (){        if(is_empty(entry_name.get_text())){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430              alert(\"Enter the name\");              entry_name.grab_focus();\/\/\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u043e\u043a\u0443\u0441              return;          }          GLib.File file = GLib.File.new_for_path(directory_path+\"\/\"+entry_name.get_text().strip()+\".desktop\");          if(file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c             alert(\"A file with the same name already exists\");             entry_name.grab_focus();             return;          }          var dialog_create_desktop_file = new Gtk.MessageDialog(this,Gtk.DialogFlags.MODAL,Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, \"Create file \"+file.get_basename()+\" ?\");           dialog_create_desktop_file.set_title(\"Question\");           Gtk.ResponseType result = (Gtk.ResponseType)dialog_create_desktop_file.run ();           dialog_create_desktop_file.destroy();           if(result==Gtk.ResponseType.OK){               create_desktop_file();\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b           }    }<\/code><\/pre>\n<p>\u041e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u043f\u0430\u043f\u043a\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>create_desktop_file:<\/code><\/p>\n<pre><code class=\"vala\">private void create_desktop_file(){          string display;          if(checkbutton_no_display.get_active()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441              display=\"true\";          }else{              display=\"false\";          }          string terminal;          if(checkbutton_terminal.get_active()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441              terminal=\"true\";          }else{              terminal=\"false\";          }          string desktop_file=\"[Desktop Entry] Encoding=UTF-8 Type=Application NoDisplay=\"+display+\" Terminal=\"+terminal+\" Exec=\"+entry_exec.get_text().strip()+\" Icon=\"+entry_icon.get_text().strip()+\" Name=\"+entry_name.get_text().strip()+\" Comment=\"+entry_comment.get_text().strip()+\" Categories=\"+entry_categories.get_text().strip();\/\/\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e         string path=directory_path+\"\/\"+entry_name.get_text()+\".desktop\";         try {             FileUtils.set_contents (path, desktop_file);\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b         } catch (Error e) {             stderr.printf (\"Error: %s\\n\", e.message);         }         GLib.File file = GLib.File.new_for_path(path);          if(file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430              alert(\"File \"+file.get_basename()+\" is created!\\nPath: \"+path);          }else{              alert(\"Error! Could not create file\");          }        }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>on_open_directory. <\/code>\u041e\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0445\u0438\u0434\u0435\u0440\u0431\u0430\u0440\u0435.<\/p>\n<pre><code class=\"vala\">private void on_open_directory(){             try{                 Gtk.show_uri_on_window(this, \"file:\/\/\"+directory_path, Gdk.CURRENT_TIME);             }catch(Error e){                 alert(\"Error!\\n\"+e.message);             }        }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"vala\">private void on_open_exec(){         var file_chooser = new Gtk.FileChooserDialog (\"Choose a file\", this, Gtk.FileChooserAction.OPEN, \"_Cancel\", Gtk.ResponseType.CANCEL, \"_Open\", Gtk.ResponseType.ACCEPT);         if (file_chooser.run () == Gtk.ResponseType.ACCEPT) {             entry_exec.set_text(file_chooser.get_filename());         }         file_chooser.destroy ();    }<\/code><\/pre>\n<p>\u0410 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043a\u043e\u043d\u043a\u0438 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043b\u043e\u0433, \u043f\u043e\u043c\u0438\u043c\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"vala\">private void on_open_icon () {         var file_chooser = new Gtk.FileChooserDialog (\"Select image file\", this, Gtk.FileChooserAction.OPEN, \"_Cancel\", Gtk.ResponseType.CANCEL, \"_Open\", Gtk.ResponseType.ACCEPT); \t    Gtk.FileFilter filter = new Gtk.FileFilter (); \t\tfile_chooser.set_filter (filter);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \t\tfilter.add_mime_type (\"image\/jpeg\");         filter.add_mime_type (\"image\/png\");         Gtk.Image preview_area = new Gtk.Image (); \t\tfile_chooser.set_preview_widget (preview_area);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\tfile_chooser.update_preview.connect (() =&gt; { \t\t\tstring uri = file_chooser.get_preview_uri (); \t\t\tstring path = file_chooser.get_preview_filename(); \t\t\tif (uri != null &amp;&amp; uri.has_prefix (\"file:\/\/\") == true) { \t\t\t\ttry { \t\t\t\t\tGdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file_at_scale (path, 250, 250, true); \t\t\t\t\tpreview_area.set_from_pixbuf (pixbuf);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \t\t\t\t\tpreview_area.show ();\/\/\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\t\t\t} catch (Error e) { \t\t\t\t\tpreview_area.hide ();\/\/\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\t\t\t} \t\t\t} else { \t\t\t\tpreview_area.hide (); \t\t\t} \t\t});         if (file_chooser.run () == Gtk.ResponseType.ACCEPT) {             entry_icon.set_text(file_chooser.get_filename());         }         file_chooser.destroy ();        }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e:<\/p>\n<pre><code class=\"vala\">private void alert (string str){           var dialog_alert = new Gtk.MessageDialog(this, Gtk.DialogFlags.MODAL, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, str);           dialog_alert.set_title(\"Message\");           dialog_alert.run();           dialog_alert.destroy();        }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"vala\">private bool is_empty(string str){           return str.strip().length == 0;         }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435! \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u0442 \u0431\u044b\u043b \u0434\u043b\u044f \u0412\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/sourceforge.net\/projects\/simple-dfc\/\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 SourceForge. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0445!<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/itsoft\/blog\/549418\/\"> https:\/\/habr.com\/ru\/company\/itsoft\/blog\/549418\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 GNU\/Linux \u0437\u043d\u0430\u0447\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u043c\u0435\u043d\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.desktop<\/code> \u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u043a\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0445 \u043d\u0435\u0442 \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e desktop-\u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 desktop-\u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0438\u0433\u0440\u044b nsnake:<\/p>\n<pre><code class=\"json\">[Desktop Entry] Version=1.1 Type=Application Name=nsnake GenericName=Classic snake game on the terminal NoDisplay=false\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432 \u043c\u0435\u043d\u044e Icon=nsnake Exec=nsnake Terminal=true\/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 Actions= Categories=ActionGame;Game; Keywords=snake;ncurses;textual;terminal;<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u043e \u044f \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0430\u0440\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (Name), \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (Exec) \u0438 \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u043a\u043e\u043d\u043a\u0438 (Icon). \u0415\u0441\u043b\u0438 \u0438\u043a\u043e\u043d\u043a\u0438 \u043d\u0435\u0442 \u0438 \u043d\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0435\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442 \u0438\u043a\u043e\u043d\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h2>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f <a href=\"https:\/\/github.com\/alexkdeveloper\/desktop-files-creator\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f, \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 CREATE. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c  \u0438\u043b\u0438 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u0412 \u0445\u0438\u0434\u0435\u0440\u0431\u0430\u0440\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/.local\/share\/applications. <\/code>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430&nbsp;\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h2>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Vala \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 GNOME Builder. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0441\u0430\u043c\u0443\u044e \u0441\u0432\u0435\u0436\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0440\u0435\u0434\u044b (40.0) \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Flathub. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0435\u0449\u0435 \u0431\u0430\u0433\u043e\u0432\u0430\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0435\u043b\u0430\u043b \u0432 Glade.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u043a\u0438 \u0432 \u043f\u043e\u043b\u044f\u0445 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043a \u043d\u0438\u043c, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>directory_path <\/code>\u043f\u0443\u0442\u044c&nbsp;\u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 desktop-\u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0441\u043b\u0438 \u043f\u0430\u043f\u043a\u0430 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 CREATE, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"vala\">        button_open.clicked.connect(on_open_directory);         button_create.clicked.connect(on_create_file);         directory_path = Environment.get_home_dir()+\"\/.local\/share\/applications\";         GLib.File file = GLib.File.new_for_path(directory_path);          if(!file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f             alert(\"Error!\\nPath \"+directory_path+\" is not exists!\\nThe program will not be able to perform its functions.\");             button_create.set_sensitive(false);\/\/\u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 CREATE            }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 CREATE \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>on_create_file:<\/code><\/p>\n<pre><code class=\"vala\">private void on_create_file (){        if(is_empty(entry_name.get_text())){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430              alert(\"Enter the name\");              entry_name.grab_focus();\/\/\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u043e\u043a\u0443\u0441              return;          }          GLib.File file = GLib.File.new_for_path(directory_path+\"\/\"+entry_name.get_text().strip()+\".desktop\");          if(file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c             alert(\"A file with the same name already exists\");             entry_name.grab_focus();             return;          }          var dialog_create_desktop_file = new Gtk.MessageDialog(this,Gtk.DialogFlags.MODAL,Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, \"Create file \"+file.get_basename()+\" ?\");           dialog_create_desktop_file.set_title(\"Question\");           Gtk.ResponseType result = (Gtk.ResponseType)dialog_create_desktop_file.run ();           dialog_create_desktop_file.destroy();           if(result==Gtk.ResponseType.OK){               create_desktop_file();\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b           }    }<\/code><\/pre>\n<p>\u041e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u043f\u0430\u043f\u043a\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>create_desktop_file:<\/code><\/p>\n<pre><code class=\"vala\">private void create_desktop_file(){          string display;          if(checkbutton_no_display.get_active()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441              display=\"true\";          }else{              display=\"false\";          }          string terminal;          if(checkbutton_terminal.get_active()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441              terminal=\"true\";          }else{              terminal=\"false\";          }          string desktop_file=\"[Desktop Entry] Encoding=UTF-8 Type=Application NoDisplay=\"+display+\" Terminal=\"+terminal+\" Exec=\"+entry_exec.get_text().strip()+\" Icon=\"+entry_icon.get_text().strip()+\" Name=\"+entry_name.get_text().strip()+\" Comment=\"+entry_comment.get_text().strip()+\" Categories=\"+entry_categories.get_text().strip();\/\/\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e         string path=directory_path+\"\/\"+entry_name.get_text()+\".desktop\";         try {             FileUtils.set_contents (path, desktop_file);\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b         } catch (Error e) {             stderr.printf (\"Error: %s\\n\", e.message);         }         GLib.File file = GLib.File.new_for_path(path);          if(file.query_exists()){\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430              alert(\"File \"+file.get_basename()+\" is created!\\nPath: \"+path);          }else{              alert(\"Error! Could not create file\");          }        }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>on_open_directory. <\/code>\u041e\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0445\u0438\u0434\u0435\u0440\u0431\u0430\u0440\u0435.<\/p>\n<pre><code class=\"vala\">private void on_open_directory(){             try{                 Gtk.show_uri_on_window(this, \"file:\/\/\"+directory_path, Gdk.CURRENT_TIME);             }catch(Error e){                 alert(\"Error!\\n\"+e.message);             }        }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"vala\">private void on_open_exec(){         var file_chooser = new Gtk.FileChooserDialog (\"Choose a file\", this, Gtk.FileChooserAction.OPEN, \"_Cancel\", Gtk.ResponseType.CANCEL, \"_Open\", Gtk.ResponseType.ACCEPT);         if (file_chooser.run () == Gtk.ResponseType.ACCEPT) {             entry_exec.set_text(file_chooser.get_filename());         }         file_chooser.destroy ();    }<\/code><\/pre>\n<p>\u0410 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043a\u043e\u043d\u043a\u0438 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043b\u043e\u0433, \u043f\u043e\u043c\u0438\u043c\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"vala\">private void on_open_icon () {         var file_chooser = new Gtk.FileChooserDialog (\"Select image file\", this, Gtk.FileChooserAction.OPEN, \"_Cancel\", Gtk.ResponseType.CANCEL, \"_Open\", Gtk.ResponseType.ACCEPT); \t    Gtk.FileFilter filter = new Gtk.FileFilter (); \t\tfile_chooser.set_filter (filter);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \t\tfilter.add_mime_type (\"image\/jpeg\");         filter.add_mime_type (\"image\/png\");         Gtk.Image preview_area = new Gtk.Image (); \t\tfile_chooser.set_preview_widget (preview_area);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\tfile_chooser.update_preview.connect (() =&gt; { \t\t\tstring uri = file_chooser.get_preview_uri (); \t\t\tstring path = file_chooser.get_preview_filename(); \t\t\tif (uri != null &amp;&amp; uri.has_prefix (\"file:\/\/\") == true) { \t\t\t\ttry { \t\t\t\t\tGdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file_at_scale (path, 250, 250, true); \t\t\t\t\tpreview_area.set_from_pixbuf (pixbuf);\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \t\t\t\t\tpreview_area.show ();\/\/\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\t\t\t} catch (Error e) { \t\t\t\t\tpreview_area.hide ();\/\/\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \t\t\t\t} \t\t\t} else { \t\t\t\tpreview_area.hide (); \t\t\t} \t\t});         if (file_chooser.run () == Gtk.ResponseType.ACCEPT) {             entry_icon.set_text(file_chooser.get_filename());         }         file_chooser.destroy ();        }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e:<\/p>\n<pre><code class=\"vala\">private void alert (string str){           var dialog_alert = new Gtk.MessageDialog(this, Gtk.DialogFlags.MODAL, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, str);           dialog_alert.set_title(\"Message\");           dialog_alert.run();           dialog_alert.destroy();        }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"vala\">private bool is_empty(string str){           return str.strip().length == 0;         }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435! \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u0442 \u0431\u044b\u043b \u0434\u043b\u044f \u0412\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f <a href=\"https:\/\/sourceforge.net\/projects\/simple-dfc\/\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 SourceForge. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0445!<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/itsoft\/blog\/549418\/\"> https:\/\/habr.com\/ru\/company\/itsoft\/blog\/549418\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320620","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320620"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320620\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}