commit 72abd34637d6644eed5a3f37644379f93630e7ed Author: Gregory Bednov Date: Thu Jan 2 21:27:01 2025 +0300 new file: desktop.nix new file: folderIcon.svg new file: pcmanfm.conf new file: tint2conf.1 new file: tint2conf.2 new file: wallpaper.svg deleted: desktop.nix flake.nix weekday.hs diff --git a/desktop.nix b/desktop.nix new file mode 100644 index 0000000..090a69f --- /dev/null +++ b/desktop.nix @@ -0,0 +1,155 @@ +let + wallpaper = builtins.readFile "./wallpaper.svg"; + folderIcon = builtins.readFile "./folderIcon.svg"; + pcmanfmConf = builtins.readFile "./pcmanfm.conf"; + desktopItems0 = (pkgs.writeText "desktop-items-0.conf" +'' +[*] +wallpaper_mode=center +wallpaper_common=1 +wallpapers_configured=1 +wallpaper=${wallpaper} +desktop_bg=#77767b +desktop_fg=#ffffff +desktop_shadow=#000000 +desktop_font=Sans 12 +folder=/home/student +show_wm_menu=1 +sort=mtime;ascending; +show_documents=0 +show_trash=1 +show_mounts=1 +''); + tint2conf1 = builtins.readFile "./tint2conf.1"; + tint2conf2 = builtins.readFile "./tint2conf.2"; + tint2config = pkgs.writeText "tint2conf" +'' +${tint2conf1} +#------------------------------------- +button = new +button_lclick_command = ${jgmenu_run_prepared} +button_icon = ${wallpaper} + +separator = new +separator_style = empty +separator_padding = 3 4 + +button = new +button_lclick_command = ${pkgs.chromium}/bin/chromium +button_icon = ${pkgs.chromium}/share/icons/hicolor/48x48/apps/chromium.png + +button = new +button_lclick_command = ${pkgs.pcmanfm}/bin/pcmanfm +button_icon = ${folderIcon} + +separator = new +separator_style = empty +separator_padding = 3 4 + +#------------------------------------- +execp = new +execp_name = switch +execp_command = ${pkgs.xkb-switch}/bin/xkb-switch +execp_interval = 1 +execp_font = mono 10 +execp_font_color = #dddddd 100 +execp_centered = 1 +execp_has_icon = 0 +execp_padding = 5 5 + +#------------------------------------- +execp = new +execp_name = mireaweek +execp_command = ${mireaweek}/bin/weekday +execp_interval = 0 +execp_font = mono 10 +execp_font_color = #dddddd 100 +execp_centered = 1 +execp_has_icon = 0 +execp_padding = 5 5 + +${tint2conf2} +''; +jgmenu_run_prepared = + (pkgs.writeShellScript "jgmenu_run_prepared" '' + ${pkgs.jgmenu}/bin/jgmenu_run apps | ${preparejgmenu} | ${pkgs.jgmenu}/bin/jgmenu --simple +''); +powermenu = (pkgs.writeShellScript "powermenu" +'' +if [ "$1" = "poweroff" ]; then + ${pkgs.zenity}/bin/zenity --question --text "Уверены, что хотите выключить?" --default-cancel && poweroff + exit 0 +fi + +if [ "$1" = "reboot" ]; then + ${pkgs.zenity}/bin/zenity --question --text "Уверены, что хотите перезагрузить?" --default-cancel && reboot + exit 0 +fi +''); + mireaweek = pkgs.stdenv.mkDerivation rec { + pname = "mireaweek"; + version = "0.2.0"; + src = pkgs.writeTextFile { + name = "weekday.hs"; + text = '' +import Data.Time +import Data.Time.Calendar.WeekDate (toWeekDate) + +data Period = Autumn + | Winter + | Spring + deriving (Show, Eq) + +period :: (Ord a, Num t) => (MonthOfYear -> t -> a) -> a -> Period +period thisYear today + | today < thisYear February 9 = Winter + | today >= thisYear September 1 = Autumn + | otherwise = Spring + +week :: Period -> Day -> String +week Winter _ = "Хороших праздников, удачной сессии!" +week p d + | dayOfWeek d == Sunday = "Сегодня воскресенье, лучше иди домой" + | otherwise = show x ++ " неделя" where + x = 1 + x0 - x1 - if limitIsSunday then 1 else 0 + limitIsSunday = dayOfWeek limit == Sunday + (_, x1, _) = toWeekDate limit + (y, x0, _) = toWeekDate d + limit = if p == Spring + then this February 9 + else this September 1 + this = fromGregorian y +main :: IO () +main = do + now <- getCurrentTime + let today = utctDay now + --let today = fromGregorian 2024 September 9 -- it was TEST + let (year,_,_) = toGregorian today + putStr $ week (period (fromGregorian year) today) today''; + }; + dontInstall = true; + dontUnpack = true; + nativeBuildInputs = [pkgs.ghc]; + buildPhase = '' + mkdir -p $out/bin + ghc $src -o $out/bin/weekday + ''; +}; + tint2 = pkgs.writeScriptBin "tint2" "${pkgs.tint2}/bin/tint2 -c ${tint2config}"; + preparejgmenu = (pkgs.writeShellScript "preparejgmenu" +'' +str=$(cat - | sed "/soffice --math/d; /soffice --draw/d; /startcenter/d; /soffice --base/d; /apps-dir-Settings/d; /tint2conf/d; /nvidia-settings/d; /--desktop-pref/d; /xterm/d; /jgmenu/d; /tint2/d; +s/,applications-system/,applications-system,\nВыключение...,^checkout(apps-dir-Powermenu),applications-powermenu/; +s/\^tag(apps-dir-Powermenu)/\^tag(apps-dir-Powermenu)\nArchi (Archimate Modeling Tool),Archi,Archi,,#Education/; +s/,applications-office/,applcations-office\nБД и проек-ие,^checkout(apps-dir-Database),applications-database/; +/\^tag(apps-dir-Education)/d; +s/apps-dir-Other/apps-dir-Database/; +/Прочее/d; +s/\^tag(apps-dir-Programming)/\^tag(apps-dir-Programming)\nSimInTech,simintech,simintech,,#Education/; +s/\^tag(apps-dir-Database)/\^tag(apps-dir-Database)\nArchi (Archimate Modeling Tool),Archi,Archi,,#Education/; ") + +printf "$str\n\n^tag(apps-dir-Powermenu)\nВыключить,${powermenu} poweroff,,,#System\nПерезагрузить,${powermenu} reboot,,,#System\n" +''); + myxinitrc = pkgs.writeText ".xinitrc" "${tint2} &\n${pkgs.pcmanfm}/bin/pcmanfm --desktop &\nexec ${pkgs.metacity}"; +in + myxinitrc; \ No newline at end of file diff --git a/folderIcon.svg b/folderIcon.svg new file mode 100644 index 0000000..d4720a7 --- /dev/null +++ b/folderIcon.svg @@ -0,0 +1 @@ + diff --git a/pcmanfm.conf b/pcmanfm.conf new file mode 100644 index 0000000..69784a2 --- /dev/null +++ b/pcmanfm.conf @@ -0,0 +1,26 @@ +[config] +bm_open_method=0 + +[volume] +mount_on_startup=1 +mount_removable=1 +autorun=1 + +[ui] +always_show_tabs=0 +max_tab_chars=32 +win_width=640 +win_height=480 +splitter_pos=150 +media_in_new_tab=0 +desktop_folder_new_win=1 +change_tab_on_drop=1 +close_on_unmount=1 +focus_previous=0 +side_pane_mode=places +view_mode=icon +show_hidden=0 +sort=name;ascending; +toolbar=newtab;navigation;home; +show_statusbar=1 +pathbar_mode_buttons=0 \ No newline at end of file diff --git a/tint2conf.1 b/tint2conf.1 new file mode 100644 index 0000000..3f45bcc --- /dev/null +++ b/tint2conf.1 @@ -0,0 +1,124 @@ +#------------------------------------- +# Backgrounds +# Background 1: Panel +rounded = 0 +border_width = 0 +background_color = #000000 60 +border_color = #000000 30 +background_color_hover = #000000 60 +border_color_hover = #000000 30 +background_color_pressed = #000000 60 +border_color_pressed = #000000 30 + +# Background 2: Default task, Iconified task +rounded = 4 +border_width = 1 +background_color = #777777 20 +border_color = #777777 30 +background_color_hover = #aaaaaa 22 +border_color_hover = #eaeaea 44 +background_color_pressed = #555555 4 +border_color_pressed = #eaeaea 44 + +# Background 3: Active task +rounded = 4 +border_width = 1 +background_color = #777777 20 +border_color = #ffffff 40 +background_color_hover = #aaaaaa 22 +border_color_hover = #eaeaea 44 +background_color_pressed = #555555 4 +border_color_pressed = #eaeaea 44 + +# Background 4: Urgent task +rounded = 4 +border_width = 1 +background_color = #aa4400 100 +border_color = #aa7733 100 +background_color_hover = #cc7700 100 +border_color_hover = #aa7733 100 +background_color_pressed = #555555 4 +border_color_pressed = #aa7733 100 + +# Background 5: Tooltip +rounded = 1 +border_width = 1 +background_color = #ffffaa 100 +border_color = #000000 100 +background_color_hover = #ffffaa 100 +border_color_hover = #000000 100 +background_color_pressed = #ffffaa 100 +border_color_pressed = #000000 100 + +#------------------------------------- +# Panel +panel_items = P:PP:TSEEC +panel_size = 100% 30 +panel_margin = 0 0 +panel_padding = 2 0 2 +panel_background_id = 1 +wm_menu = 1 +panel_dock = 0 +panel_position = bottom center horizontal +panel_layer = top +panel_monitor = all +primary_monitor_first = 0 +autohide = 0 +autohide_show_timeout = 0 +autohide_hide_timeout = 0.5 +autohide_height = 2 +strut_policy = follow_size +panel_window_name = tint2 +disable_transparency = 1 +mouse_effects = 1 +font_shadow = 0 +mouse_hover_icon_asb = 100 0 10 +mouse_pressed_icon_asb = 100 0 0 + +#------------------------------------- +# Taskbar +taskbar_mode = single_desktop +taskbar_padding = 0 0 2 +taskbar_background_id = 0 +taskbar_active_background_id = 0 +#taskbar_name = 1 +taskbar_hide_inactive_tasks = 0 +taskbar_hide_different_monitor = 0 +taskbar_always_show_all_desktop_tasks = 0 +#taskbar_name_padding = 4 2 +#taskbar_name_background_id = 0 +#taskbar_name_active_background_id = 0 +#taskbar_name_font_color = #e3e3e3 100 +#taskbar_name_active_font_color = #ffffff 100 +taskbar_distribute_size = 0 +taskbar_sort_order = none +task_align = left + +#------------------------------------- +# Task +task_text = 1 +task_icon = 1 +task_centered = 1 +urgent_nb_of_blink = 100000 +task_maximum_size = 150 35 +task_padding = 2 2 4 +task_tooltip = 1 +task_font_color = #ffffff 100 +task_background_id = 2 +task_active_background_id = 3 +task_urgent_background_id = 4 +task_iconified_background_id = 2 +mouse_left = toggle_iconify +mouse_middle = none +mouse_right = close +mouse_scroll_up = toggle +mouse_scroll_down = iconify + +#------------------------------------- +# System tray (notification area) +systray_padding = 0 4 2 +systray_background_id = 0 +systray_sort = ascending +systray_icon_size = 24 +systray_icon_asb = 100 0 0 +systray_monitor = 1 diff --git a/tint2conf.2 b/tint2conf.2 new file mode 100644 index 0000000..4c1b953 --- /dev/null +++ b/tint2conf.2 @@ -0,0 +1,41 @@ +#------------------------------------- +# Clock +time1_format = %H:%M +time2_format = %A %d %B +time1_timezone = +time2_timezone = +clock_font_color = #ffffff 100 +clock_padding = 2 0 +clock_background_id = 0 +clock_tooltip = +clock_tooltip_timezone = +clock_lclick_command = +clock_rclick_command = orage +clock_mclick_command = +clock_uwheel_command = +clock_dwheel_command = + +#------------------------------------- +# Battery +battery_tooltip = 1 +battery_low_status = 10 +battery_low_cmd = notify-send "battery low" +battery_font_color = #ffffff 100 +battery_padding = 1 0 +battery_background_id = 0 +battery_hide = 101 +battery_lclick_command = +battery_rclick_command = +battery_mclick_command = +battery_uwheel_command = +battery_dwheel_command = +ac_connected_cmd = +ac_disconnected_cmd = + +#------------------------------------- +# Tooltip +tooltip_show_timeout = 0.5 +tooltip_hide_timeout = 0.1 +tooltip_padding = 2 2 +tooltip_background_id = 5 +tooltip_font_color = #222222 100 \ No newline at end of file diff --git a/wallpaper.svg b/wallpaper.svg new file mode 100644 index 0000000..103b5b1 --- /dev/null +++ b/wallpaper.svg @@ -0,0 +1 @@ + \ No newline at end of file